标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
omap mux系统 | 1369 | 0 | 0 | 2013-01-21 | |
Pandaboard ES编译bootloader、xloader、内核、以及安卓系统 | 2569 | 0 | 1 | 2012-08-02 | |
Pandaboard ES学习日志_总体开发流程 | 2471 | 0 | 1 | 2012-08-02 | |
pandaboard与beagleboard的NFS,TFTP,以及dhcp服务设置 | 1822 | 0 | 1 | 2012-08-02 | |
玩转pandaboard之linaro对于Android的编译上的一些优化 | 2075 | 0 | 1 | 2012-08-02 | |
玩转pandaboard之rootfs制作及启动 | 1572 | 0 | 1 | 2012-08-02 | |
OMAP4开发资源总结 | 1411 | 0 | 1 | 2012-07-13 | |
基于omap4430(pandaboard)的android4.0.3的下载编译成功体现android4.0 | 1184 | 0 | 1 | 2012-07-13 | |
Precise Pangolin (12.04) Installation Instructions | 1516 | 0 | 1 | 2012-06-29 | |
PandaBoard ES: Getting Started with Ubuntu 12.04 LTS Desktop | 1966 | 0 | 1 | 2012-06-29 |
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 ,这两个函数不一样吗,自我感觉有点多次一举,,,不太明白