*参照元 [#zfc4ad2b]
#backlinks
*説明 [#hdd5c8ba]
-パス: [[linux-4.4.1/fs/char_dev.c]]
-FIXME: これは何?
--説明
**引数 [#dd1b8e75]
-なし
**返り値 [#tde56659]
-struct cdev *
--
--[[linux-4.4.1/cdev]]
**参考 [#z6a9485f]
*実装 [#cbd5bc06]
/**
* cdev_alloc() - allocate a cdev structure
*
* Allocates and returns a cdev structure, or NULL on failure.
*/
struct cdev *cdev_alloc(void)
{
struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL);
if (p) {
INIT_LIST_HEAD(&p->list);
kobject_init(&p->kobj, &ktype_cdev_dynamic);
}
-
--[[linux-4.4.1/cdev]]
--[[linux-4.4.1/kzalloc()]]
--[[linux-4.4.1/INIT_LIST_HEAD()]]
--[[linux-4.4.1/kobject_init()]]
--[[linux-4.4.1/ktype_cdev_dynamic(global)]]
--[[linux-4.4.1/GFP_KERNEL]]
return p;
}
...
EXPORT_SYMBOL(cdev_alloc);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#z129c866]