*参照元 [#k4f799b4] #backlinks *説明 [#ue10de0b] -パス: [[linux-2.6.33/drivers/base/platform.c]] -FIXME: これは何? --説明 **引数 [#yc03f3af] -struct platform_driver *drv -- --[[linux-2.6.33/platform_driver]] **返り値 [#y85b5162] -int --0: 成功、0 以外: 失敗 --失敗時はエラー番号(errno.h を参照)を負の値で返すのが通例(-EINVAL など)である。 --[[linux-2.6.33/include/linux/errno.h]] **参考 [#l56b34b1] *実装 [#u4d0e567] /** * platform_driver_register * @drv: platform driver structure */ int platform_driver_register(struct platform_driver *drv) { 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]] - --[[linux-2.6.33/platform_bus_type(global)]] if (drv->probe) drv->driver.probe = platform_drv_probe; - -特に何も指定されていなければ、 デフォルトの関数 platform_drv_probe() を使用する。 --[[linux-2.6.33/platform_drv_probe()]] if (drv->remove) drv->driver.remove = platform_drv_remove; - -特に何も指定されていなければ、 デフォルトの関数 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_driver_register); -GPL のモジュールにのみシンボルを公開する。 --[[linux-2.6.33/EXPORT_SYMBOL_GPL()]] *コメント [#ya4e2d4e]