linux-4.4.1/__class_create()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#m0fec2be]
#backlinks
*説明 [#bb8393af]
-パス: [[linux-4.4.1/drivers/base/class.c]]
-FIXME: これは何?
--説明
**引数 [#ode30e81]
-struct module *owner
--
--[[linux-4.4.1/module]]
-const char *name
--
-struct lock_class_key *key
--
--[[linux-4.4.1/lock_class_key]]
**返り値 [#zd69b705]
-struct class *
--
--[[linux-4.4.1/class]]
**参考 [#j4ab1999]
*実装 [#q5d7dcbc]
/**
* class_create - create a struct class structure
* @owner: pointer to the module that is to "own" this s...
* @name: pointer to a string for the name of this class.
* @key: the lock_class_key for this class; used by mute...
*
* This is used to create a struct class pointer that ca...
* in calls to device_create().
*
* Returns &struct class pointer on success, or ERR_PTR(...
*
* Note, the pointer created here is to be destroyed whe...
* making a call to class_destroy().
*/
struct class *__class_create(struct module *owner, const...
struct lock_class_key *key)
{
struct class *cls;
int retval;
-
--[[linux-4.4.1/class]]
cls = kzalloc(sizeof(*cls), GFP_KERNEL);
if (!cls) {
retval = -ENOMEM;
goto error;
}
-
--[[linux-4.4.1/kzalloc()]]
cls->name = name;
cls->owner = owner;
cls->class_release = class_create_release;
-
--[[linux-4.4.1/class_create_release()]]
retval = __class_register(cls, key);
if (retval)
goto error;
-
--[[linux-4.4.1/__class_register()]]
return cls;
error:
kfree(cls);
return ERR_PTR(retval);
-
--[[linux-4.4.1/kfree()]]
--[[linux-4.4.1/ERR_PTR()]]
}
EXPORT_SYMBOL_GPL(__class_create);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#g3d84b2f]
終了行:
*参照元 [#m0fec2be]
#backlinks
*説明 [#bb8393af]
-パス: [[linux-4.4.1/drivers/base/class.c]]
-FIXME: これは何?
--説明
**引数 [#ode30e81]
-struct module *owner
--
--[[linux-4.4.1/module]]
-const char *name
--
-struct lock_class_key *key
--
--[[linux-4.4.1/lock_class_key]]
**返り値 [#zd69b705]
-struct class *
--
--[[linux-4.4.1/class]]
**参考 [#j4ab1999]
*実装 [#q5d7dcbc]
/**
* class_create - create a struct class structure
* @owner: pointer to the module that is to "own" this s...
* @name: pointer to a string for the name of this class.
* @key: the lock_class_key for this class; used by mute...
*
* This is used to create a struct class pointer that ca...
* in calls to device_create().
*
* Returns &struct class pointer on success, or ERR_PTR(...
*
* Note, the pointer created here is to be destroyed whe...
* making a call to class_destroy().
*/
struct class *__class_create(struct module *owner, const...
struct lock_class_key *key)
{
struct class *cls;
int retval;
-
--[[linux-4.4.1/class]]
cls = kzalloc(sizeof(*cls), GFP_KERNEL);
if (!cls) {
retval = -ENOMEM;
goto error;
}
-
--[[linux-4.4.1/kzalloc()]]
cls->name = name;
cls->owner = owner;
cls->class_release = class_create_release;
-
--[[linux-4.4.1/class_create_release()]]
retval = __class_register(cls, key);
if (retval)
goto error;
-
--[[linux-4.4.1/__class_register()]]
return cls;
error:
kfree(cls);
return ERR_PTR(retval);
-
--[[linux-4.4.1/kfree()]]
--[[linux-4.4.1/ERR_PTR()]]
}
EXPORT_SYMBOL_GPL(__class_create);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#g3d84b2f]
ページ名: