- 追加された行はこの色です。
- 削除された行はこの色です。
*参照元 [#k4f799b4]
#backlinks
*説明 [#ue10de0b]
-パス: [[linux-2.6.33/drivers/base/platform.c]]
-FIXME: これは何?
--説明
**引数 [#yc03f3af]
-struct platform_device *pdev
-struct platform_driver *drv
--
--[[linux-2.6.33/platform_device]]
--[[linux-2.6.33/platform_driver]]
**返り値 [#y85b5162]
-int
--
--0: 成功、0 以外: 失敗
--失敗時はエラー番号(errno.h を参照)を負の値で返すのが通例(-EINVAL など)である。
--[[linux-2.6.33/include/linux/errno.h]]
**参考 [#l56b34b1]
*実装 [#u4d0e567]
/**
* platform_device_register - add a platform-level device
* @pdev: platform device we're adding
* platform_driver_register
* @drv: platform driver structure
*/
int platform_device_register(struct platform_device *pdev)
int platform_driver_register(struct platform_driver *drv)
{
device_initialize(&pdev->dev);
drv->driver.bus = &platform_bus_type;
-drv->driver は struct device_driver 型である。注: ポインタではない。
--[[linux-2.6.33/device_driver]]
-drv->driver.bus は struct bus_type *型である。
--[[linux-2.6.33/bus_type]]
if (drv->probe)
drv->driver.probe = platform_drv_probe;
-
--[[linux-2.6.33/device_initialize()]]
-特に何も指定されていなければ、
デフォルトの関数 platform_drv_probe() を使用する。
--[[linux-2.6.33/platform_drv_probe()]]
return platform_device_add(pdev);
if (drv->remove)
drv->driver.remove = platform_drv_remove;
-
--[[linux-2.6.33/platform_device_add()]]
-特に何も指定されていなければ、
デフォルトの関数 platform_drv_remove() を使用する。
--[[linux-2.6.33/platform_drv_remove()]]
if (drv->shutdown)
drv->driver.shutdown = platform_drv_shutdown;
-
-特に何も指定されていなければ、
デフォルトの関数 platform_drv_shutdown() を使用する。
--[[linux-2.6.33/platform_drv_shutdown()]]
return driver_register(&drv->driver);
-
--[[linux-2.6.33/driver_register()]]
}
EXPORT_SYMBOL_GPL(platform_device_register);
-
EXPORT_SYMBOL_GPL(platform_driver_register);
-GPL ライセンスのモジュールだけにシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL_GPL()]]
*コメント [#ya4e2d4e]