当前位置:网站首页>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 ...
边栏推荐
- 【系统管理】清理任务栏的已删除程序的图标缓存
- idea gradle lombok 报错集锦
- Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
- 使用 BR 备份 TiDB 集群到 GCS
- 学习使用js把两个对象合并成一个对象的方法Object.assign()
- 使用Thread类和Runnable接口实现多线程的区别
- 见到小叶栀子
- 三重半圆环进度条,直接拿去就能用
- See Gardenia minor
- EasyCVR集群重启导致其他服务器设备通道状态离线情况的优化
猜你喜欢
Food Chem | in depth learning accurately predicts food categories and nutritional components based on ingredient statements
2022 electrician cup question B analysis of emergency materials distribution under 5g network environment
Win11图片打不开怎么办?Win11无法打开图片的修复方法
Dab-detr: dynamic anchor boxes are better queries for Detr translation
史上最全MongoDB之安全认证
Ssm+jsp realizes enterprise management system (OA management system source code + database + document +ppt)
[coded font series] opendyslexic font
接口自动化测试实践指导(中):接口测试场景有哪些
kivy教程之设置窗体大小和背景(教程含源码)
Food Chem|深度学习根据成分声明准确预测食品类别和营养成分
随机推荐
测试/开发程序员怎么升职?从无到有,从薄变厚.......
Restore backup data on GCS with br
Opencv third party Library
機器人(自動化)課程的持續學習-2022-
What is CGI, IIS, and VPS "suggested collection"
Storage of data
UltraEdit-32 warm prompt: right association, cancel bak file [easy to understand]
idea gradle lombok 报错集锦
ABAP dynamic inner table grouping cycle
见到小叶栀子
科兴与香港大学临床试验中心研究团队和香港港怡医院合作,在中国香港启动奥密克戎特异性灭活疫苗加强剂临床试验
Unity3d can change colors and display samples in a building GL material
如何编写一个程序猿另一个面试官眼前一亮的简历[通俗易懂]
【自动化经验谈】自动化测试成长之路
How do test / development programmers get promoted? From nothing, from thin to thick
Redis configuration and optimization of NoSQL
[knife-4j quickly build swagger]
Dab-detr: dynamic anchor boxes are better queries for Detr translation
EasyCVR集群重启导致其他服务器设备通道状态离线情况的优化
EasyCVR平台接入RTMP协议,接口调用提示获取录像错误该如何解决?