您的位置:首页 > 运维架构

void cdev_init(struct cdev *cdev, const struct file_operations *fops)

2013-07-20 13:20 525 查看
fs/char_dev.c

/**

* cdev_init() - initialize a cdev structure

* @cdev: the structure to initialize

* @fops: the file_operations for this device

*

* Initializes @cdev, remembering @fops, making it ready to add to the

* system with cdev_add().

*/

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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: