标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
ARM开发经典学习网站推荐 | 1062 | 0 | 0 | 2012-06-20 | |
dev_dbg() | 998 | 0 | 0 | 2012-06-19 | |
#ifdef 中的逻辑与或操作 | 1193 | 0 | 0 | 2012-06-19 | |
windows是如何处理android复合设备驱动的? | 655 | 0 | 0 | 2012-06-19 | |
android usb 分析(2) | 78 | 0 | 0 | 2012-06-19 | |
android usb 分析1 | 96 | 0 | 0 | 2012-06-19 | |
Android中低电量的处理方法 | 1088 | 0 | 0 | 2012-06-12 | |
Android Battery 分析 | 868 | 0 | 0 | 2012-06-11 | |
嵌入式Linux的实时性分析和改进 | 930 | 0 | 1 | 2012-06-04 | |
Linux内核的cpufreq(变频)机制 | 720 | 0 | 0 | 2012-06-01 | |
How to Make Ubuntu 12.04 Look Like Mac OS Lion | 987 | 0 | 0 | 2012-06-01 | |
DMA及cache一致性的学习心得 | 865 | 0 | 0 | 2012-05-23 | |
DMA及cache一致性的学习心得 | 0 | 0 | 0 | 2012-05-23 | |
DMA及cache一致性的学习心得 | 1210 | 0 | 1 | 2012-05-23 | |
linux内核信号量学习(2.6.23(i386)) | 752 | 0 | 0 | 2012-05-22 | |
arm电源管理(3)--s3c2410 pm.c | 1235 | 0 | 1 | 2012-05-17 | |
arm电源管理(1)--apm.c | 1151 | 0 | 1 | 2012-05-17 | |
基于ARM的电源管理 | 1944 | 0 | 1 | 2012-05-17 | |
Android Battery 分析 | 980 | 0 | 0 | 2012-05-16 | |
移植wireless tools 到android | 1274 | 0 | 0 | 2012-05-04 |
chen_chuang2012-10-11 16:33
高手,有本书上写cdev初始化和注册是这样写的
static void VirtualDisk_setup_cdev(struct VirtualDisk *dev, int minor)
{
int err;
devno = MDDEV(VirtualDisk_major, minor);
cdev_init(&dev->cdev, &VirtualDisk_fops);
dev->cdev.owner = THIS_MOUDULE;
dev->cdev.ops = &VirtualDisk_fops;
err = cdev_add(&dev->cdev, debno, 1);
if (err)
printk(KERN_NOTICE "Error in cdev_add()\n");
}
而cdev_init里
void cdev_init(struct cdev *cdev, const struct file_operations *fops)
{
memset(cdev, 0, sizeof *cdev);
INIT_LIST_HEAD(&cdev->list);
kobject_init(&cdev->kobj, &ktype_cdev_default);
cdev->ops = fops;
}
已经有cdev->ops = fops了
那上面的代码cdev_init之后又有dev->cdev.ops ,这两个函数不一样吗,自我感觉有点多次一举,,,不太明白