diff options
author | Stephen Boyd <stephen.boyd@linaro.org> | 2016-06-26 08:38:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-09 17:06:49 +0300 |
commit | 1ebe88d38ddec6b05f7b5e64acef30a98a4ad17e (patch) | |
tree | cc0a1eb5d909f3f61f66031b58b271c4b9d74eb8 /include/linux/ulpi | |
parent | 3cc7e7b7872ebd0f200b5450f5471bc3700de141 (diff) | |
download | linux-1ebe88d38ddec6b05f7b5e64acef30a98a4ad17e.tar.xz |
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 'include/linux/ulpi')
-rw-r--r-- | include/linux/ulpi/driver.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/ulpi/driver.h b/include/linux/ulpi/driver.h index 388f6e08b9d4..80b36ca12e80 100644 --- a/include/linux/ulpi/driver.h +++ b/include/linux/ulpi/driver.h @@ -47,7 +47,11 @@ struct ulpi_driver { #define to_ulpi_driver(d) container_of(d, struct ulpi_driver, driver) -int ulpi_register_driver(struct ulpi_driver *drv); +/* + * use a macro to avoid include chaining to get THIS_MODULE + */ +#define ulpi_register_driver(drv) __ulpi_register_driver(drv, THIS_MODULE) +int __ulpi_register_driver(struct ulpi_driver *drv, struct module *module); void ulpi_unregister_driver(struct ulpi_driver *drv); #define module_ulpi_driver(__ulpi_driver) \ |