linux-4.4.1/cdev_add()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#m8ea9c65]
#backlinks
*説明 [#oee20690]
-パス: [[linux-4.4.1/fs/char_dev.c]]
-FIXME: これは何?
--説明
**引数 [#qfb25079]
-struct cdev *p
--
--[[linux-4.4.1/cdev]]
-dev_t dev
--
--[[linux-4.4.1/dev_t]]
-unsigned count
--
**返り値 [#je8fce60]
-int
--
**参考 [#gcec26d2]
*実装 [#u40bbedc]
/**
* cdev_add() - add a char device to the system
* @p: the cdev structure for the device
* @dev: the first device number for which this device i...
* @count: the number of consecutive minor numbers corre...
* device
*
* cdev_add() adds the device represented by @p to the s...
* live immediately. A negative error code is returned ...
*/
int cdev_add(struct cdev *p, dev_t dev, unsigned count)
{
int error;
p->dev = dev;
p->count = count;
error = kobj_map(cdev_map, dev, count, NULL,
exact_match, exact_lock, p);
if (error)
return error;
-
--[[linux-4.4.1/kobj_map()]]
--[[linux-4.4.1/cdev_map(global)]]
--[[linux-4.4.1/exact_match()]]
--[[linux-4.4.1/exact_lock()]]
kobject_get(p->kobj.parent);
-
--[[linux-4.4.1/kobject_get()]]
return 0;
}
...
EXPORT_SYMBOL(cdev_add);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#uf9574a4]
終了行:
*参照元 [#m8ea9c65]
#backlinks
*説明 [#oee20690]
-パス: [[linux-4.4.1/fs/char_dev.c]]
-FIXME: これは何?
--説明
**引数 [#qfb25079]
-struct cdev *p
--
--[[linux-4.4.1/cdev]]
-dev_t dev
--
--[[linux-4.4.1/dev_t]]
-unsigned count
--
**返り値 [#je8fce60]
-int
--
**参考 [#gcec26d2]
*実装 [#u40bbedc]
/**
* cdev_add() - add a char device to the system
* @p: the cdev structure for the device
* @dev: the first device number for which this device i...
* @count: the number of consecutive minor numbers corre...
* device
*
* cdev_add() adds the device represented by @p to the s...
* live immediately. A negative error code is returned ...
*/
int cdev_add(struct cdev *p, dev_t dev, unsigned count)
{
int error;
p->dev = dev;
p->count = count;
error = kobj_map(cdev_map, dev, count, NULL,
exact_match, exact_lock, p);
if (error)
return error;
-
--[[linux-4.4.1/kobj_map()]]
--[[linux-4.4.1/cdev_map(global)]]
--[[linux-4.4.1/exact_match()]]
--[[linux-4.4.1/exact_lock()]]
kobject_get(p->kobj.parent);
-
--[[linux-4.4.1/kobject_get()]]
return 0;
}
...
EXPORT_SYMBOL(cdev_add);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#uf9574a4]
ページ名: