当前位置:网站首页>Both primary and secondary equipment numbers are 0
Both primary and secondary equipment numbers are 0
2022-07-07 04:22:00 【Fiery red auspicious cloud】
As the title
After loading the drive module , The primary device number and secondary device number of the printed character device are 0
reason
Code problem
Problem code
st_ap3216cDev.dev_id = alloc_chrdev_region(&st_ap3216cDev.dev_id,0,1,NAME);
st_ap3216cDev.major = MAJOR(st_ap3216cDev.dev_id);
st_ap3216cDev.minor = MINOR(st_ap3216cDev.dev_id);
printk("Major:%d minor:%d\n",st_ap3216cDev.major,st_ap3216cDev.minor);
It looks like there's nothing wrong
Actually, the code should be :
alloc_chrdev_region(&st_ap3216cDev.dev_id,0,1,NAME);
st_ap3216cDev.major = MAJOR(st_ap3216cDev.dev_id);
st_ap3216cDev.minor = MINOR(st_ap3216cDev.dev_id);
printk("Major:%d minor:%d\n",st_ap3216cDev.major,st_ap3216cDev.minor);
- After successful application of equipment number , The return value is 0, Assign the return value to the device number variable , So the injection number and secondary equipment number printed are 0. Split ...
边栏推荐
- Collection of idea gradle Lombok errors
- Restore backup data on GCS with br
- VIM - own active button indent this command "suggestions collection"
- 2022中青杯C题城市交通思路分析
- Golang compresses and decompresses zip files
- 使用 BR 备份 TiDB 集群到 GCS
- [team learning] [34 issues] scratch (Level 2)
- Zero knowledge private application platform aleo (1) what is aleo
- Analysis on urban transportation ideas of 2022 Zhongqing cup C
- Win11远程桌面连接怎么打开?Win11远程桌面连接的五种方法
猜你喜欢
[coded font series] opendyslexic font
Some thoughts on cross end development of kbone and applet
[team learning] [34 issues] scratch (Level 2)
NFT meta universe chain diversified ecosystem development case
EasyCVR集群版本添加RTSP设备提示服务器ID错误,该如何解决?
ABAP dynamic inner table grouping cycle
Antd Comment 递归循环评论
機器人(自動化)課程的持續學習-2022-
Dab-detr: dynamic anchor boxes are better queries for Detr translation
超越Postman,新一代国产调试工具Apifox,用起来够优雅
随机推荐
Opencv third party Library
Why does WordPress open so slowly?
Highly paid programmers & interview questions. Are you familiar with the redis cluster principle of series 120? How to ensure the high availability of redis (Part 1)?
cuda编程
SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
Triple half circle progress bar, you can use it directly
In cooperation with the research team of the clinical trial center of the University of Hong Kong and Hong Kong Gangyi hospital, Kexing launched the clinical trial of Omicron specific inactivated vacc
用头像模仿天狗食月
1.19.11. SQL client, start SQL client, execute SQL query, environment configuration file, restart policy, user-defined functions, constructor parameters
NFT meta universe chain diversified ecosystem development case
使用Thread类和Runnable接口实现多线程的区别
Enter the rough outline of the URL question (continuously updated)
The first introduction of the most complete mongodb in history
opencv第三方库
Win11图片打不开怎么办?Win11无法打开图片的修复方法
Ssm+jsp realizes the warehouse management system, and the interface is called an elegant interface
英特尔David Tuhy:英特尔傲腾技术成功的原因
Use br to back up tidb cluster to GCS
ABAP dynamic inner table grouping cycle
【OA】Excel 文档生成器: Openpyxl 模块