diff options
author | Libo Chen <clbchenlibo.chen@huawei.com> | 2013-05-25 04:40:50 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-03 20:59:03 (GMT) |
commit | 9447057eaff871dd7c63c808de761b8732407169 (patch) | |
tree | 6284b1e6653b14ceb6a9193002eec6303a509a66 /drivers | |
parent | f494513ff1b3f6bee2df329d8bbe864febf05a27 (diff) | |
download | linux-fsl-qoriq-9447057eaff871dd7c63c808de761b8732407169.tar.xz |
platform_device: use a macro instead of platform_driver_register
I found a lot of mistakes using struct platform_driver without owner
so I make a macro instead of the function platform_driver_register.
It can set owner in it, then guys don`t care about module owner again.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/platform.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9eda842..ed75cf6 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -523,11 +523,13 @@ static void platform_drv_shutdown(struct device *_dev) } /** - * platform_driver_register - register a driver for platform-level devices + * __platform_driver_register - register a driver for platform-level devices * @drv: platform driver structure */ -int platform_driver_register(struct platform_driver *drv) +int __platform_driver_register(struct platform_driver *drv, + struct module *owner) { + drv->driver.owner = owner; drv->driver.bus = &platform_bus_type; if (drv->probe) drv->driver.probe = platform_drv_probe; @@ -538,7 +540,7 @@ int platform_driver_register(struct platform_driver *drv) return driver_register(&drv->driver); } -EXPORT_SYMBOL_GPL(platform_driver_register); +EXPORT_SYMBOL_GPL(__platform_driver_register); /** * platform_driver_unregister - unregister a driver for platform-level devices |