diff options
author | Stephen Boyd | 2016-06-25 22:38:21 -0700 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-08-09 16:06:49 +0200 |
commit | 1ebe88d38ddec6b05f7b5e64acef30a98a4ad17e (patch) | |
tree | cc0a1eb5d909f3f61f66031b58b271c4b9d74eb8 /drivers/usb/common | |
parent | 3cc7e7b7872ebd0f200b5450f5471bc3700de141 (diff) |
usb: ulpi: Automatically set driver::owner with ulpi_driver_register()
Let's follow other driver registration functions and
automatically set the driver's owner member to THIS_MODULE when
ulpi_driver_register() is called. This allows ulpi driver writers
to forget about this boiler plate detail and avoids common bugs
in the process.
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/common')
-rw-r--r-- | drivers/usb/common/ulpi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c index 01c0c0477a9e..e04a34e7a341 100644 --- a/drivers/usb/common/ulpi.c +++ b/drivers/usb/common/ulpi.c @@ -127,16 +127,17 @@ static struct device_type ulpi_dev_type = { * * Registers a driver with the ULPI bus. */ -int ulpi_register_driver(struct ulpi_driver *drv) +int __ulpi_register_driver(struct ulpi_driver *drv, struct module *module) { if (!drv->probe) return -EINVAL; + drv->driver.owner = module; drv->driver.bus = &ulpi_bus; return driver_register(&drv->driver); } -EXPORT_SYMBOL_GPL(ulpi_register_driver); +EXPORT_SYMBOL_GPL(__ulpi_register_driver); /** * ulpi_unregister_driver - unregister a driver with the ULPI bus |