标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
android的 low power: LP0 LP1 LP2 | 1751 | 0 | 0 | 2012-08-02 | |
ubuntu编译android4.0成功 | 1381 | 0 | 0 | 2012-07-17 | |
(64位)ubuntu 11.10编译android 2.3准备的工作 | 1004 | 0 | 0 | 2012-07-17 | |
Ubuntu系统教你创建分卷的压缩文件 | 3148 | 0 | 0 | 2012-07-16 | |
Android4: HDMI system in ICS | 1737 | 0 | 0 | 2012-07-16 | |
HDMI之EDID | 1394 | 0 | 0 | 2012-07-16 | |
imx53的HDMI口Si9022 Audio | 2438 | 0 | 0 | 2012-07-16 | |
repo init --mirror 和 --reference | 5096 | 0 | 0 | 2012-07-16 | |
BCM4330 WIFI 调试记录 | 1530 | 0 | 0 | 2012-07-13 | |
Android BCM4330 蓝牙BT驱动调试记录 | 1434 | 0 | 0 | 2012-07-13 | |
scp不需要秘密 | 1447 | 0 | 1 | 2012-07-13 | |
OMAP4开发资源总结 | 1412 | 0 | 1 | 2012-07-13 | |
基于omap4430(pandaboard)的android4.0.3的下载编译成功体现android4.0 | 1186 | 0 | 1 | 2012-07-13 | |
Timed GPIO | 1110 | 0 | 0 | 2012-07-11 | |
Linux中断(interrupt)子系统之三:中断流控处理层 | 1042 | 0 | 0 | 2012-07-09 | |
Linux驱动调试中的Debugfs的使用简介 | 1144 | 0 | 0 | 2012-07-09 | |
I2S PCM温故知新 | 1463 | 0 | 0 | 2012-07-06 | |
Android double framebuffer(how to set) | 1257 | 0 | 0 | 2012-07-06 | |
Android图形系统的分析与移植--七、双缓冲framebuffer的实现 | 1775 | 0 | 0 | 2012-07-06 | |
多项目中SVN权限管理精辟解析 | 869 | 0 | 0 | 2012-07-06 |
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 ,这两个函数不一样吗,自我感觉有点多次一举,,,不太明白