标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
移植wireless tools 到android并测试 | 1914 | 0 | 0 | 2012-08-23 | |
用NDK编译FFmpeg | 1267 | 0 | 0 | 2012-08-23 | |
ffmpeg 移植到 android | 1138 | 0 | 0 | 2012-08-23 | |
移植wireless tools 到android | 1274 | 0 | 0 | 2012-05-04 | |
busybox编译报错的解决 | 2196 | 0 | 0 | 2011-12-23 | |
minigui1.6.0在博创2410上的移植 | 1122 | 0 | 0 | 2011-12-21 | |
利用Eclipse编写minigui的helloworld程序 | 2328 | 0 | 0 | 2011-12-21 | |
MiniGUI在AT91RM9200开发板上的移植 | 858 | 0 | 0 | 2011-12-21 | |
MINIGUI在S3C2410开发板的移植 | 948 | 0 | 0 | 2011-12-21 | |
minigui x86在ubuntu安装以及qvfb的在ubuntu安装 | 1364 | 0 | 0 | 2011-12-12 | |
IPTABLES配置方法介绍 | 1032 | 0 | 0 | 2011-12-02 | |
can't initialize iptables table `nat': Table does | 2317 | 0 | 0 | 2011-12-01 | |
iptables v1.3.8: can't initialize iptables table `filter' | 5350 | 0 | 0 | 2011-12-01 | |
Android 4.0 的Linux Kernel 下载方法 | 1576 | 0 | 1 | 2011-11-19 | |
libCurl/openssl/Zlib的ARM移植 | 1412 | 0 | 0 | 2011-05-08 | |
Linux libcurl使用(一) | 1263 | 0 | 0 | 2011-04-17 | |
linux下LibCurl编程 | 1947 | 0 | 1 | 2011-04-17 | |
【推荐】 linux c libcurl的简单使用 | 1773 | 0 | 0 | 2011-04-17 | |
移植sshd到JK2410开发板 | 2110 | 0 | 1 | 2010-12-28 | |
移植ssh到arm | 1204 | 0 | 0 | 2010-12-28 |
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 ,这两个函数不一样吗,自我感觉有点多次一举,,,不太明白