- 追加された行はこの色です。
- 削除された行はこの色です。
*参照元 [#oe2104c4]
#backlinks
*説明 [#qd3959b0]
-パス: [[linux-2.6.33/drivers/base/platform.c]]
-FIXME: これは何?
--説明
**引数 [#de7cb644]
-const char *name
--
-int id
--
**返り値 [#ic416a90]
-struct platform_device *
--
--[[linux-2.6.33/platform_device]]
**参考 [#wf0661e2]
*実装 [#lfea1fc4]
/**
* platform_device_alloc
* @name: base name of the device we're adding
* @id: instance id
*
* Create a platform device object which can have other objects attached
* to it, and which will have attached objects freed when it is released.
*/
struct platform_device *platform_device_alloc(const char *name, int id)
{
struct platform_object *pa;
-
--[[linux-2.6.33/platform_object]]
pa = kzalloc(sizeof(struct platform_object) + strlen(name), GFP_KERNEL);
-
--[[linux-2.6.33/kzalloc()]]
-
--[[linux-2.6.33/GFP_KERNEL]]
if (pa) {
strcpy(pa->name, name);
pa->pdev.name = pa->name;
pa->pdev.id = id;
device_initialize(&pa->pdev.dev);
pa->pdev.dev.release = platform_device_release;
}
-
--[[linux-2.6.33/device_initialize()]]
-
--[[linux-2.6.33/platform_device_release()]]
return pa ? &pa->pdev : NULL;
}
EXPORT_SYMBOL_GPL(platform_device_alloc);
-GPL ライセンスのモジュールにのみシンボルを公開する。
-GPL のモジュールにのみシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL_GPL()]]
*コメント [#t5b61f30]