diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2014-10-28 12:40:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-06 18:16:02 -0500 |
commit | 291f653a140ad880426125e5e9dbb70f4c184683 (patch) | |
tree | 5f80732c03b2ba2c9b2ef339036b8871e6148d6b /include/linux/platform_device.h | |
parent | c3b50dc219e1437e4dcb6a1639b004648dc29faa (diff) |
core: platform: let platform_create_bundle initialize module owner
Since commit 9447057eaff8 ("platform_device: use a macro instead of
platform_driver_register"), platform_driver_register() always overwrites
the .owner field of a platform_driver with THIS_MODULE. This breaks
platform_create_bundle() which uses it via platform_driver_probe() from
within the platform core instead of the module init. Fix it by using a
similar #define construct to obtain THIS_MODULE and pass it on later.
Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/platform_device.h')
-rw-r--r-- | include/linux/platform_device.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index c8d95c60da19..ae4882ca4a64 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -240,10 +240,12 @@ static void __exit __platform_driver##_exit(void) \ | |||
240 | } \ | 240 | } \ |
241 | module_exit(__platform_driver##_exit); | 241 | module_exit(__platform_driver##_exit); |
242 | 242 | ||
243 | extern struct platform_device *platform_create_bundle( | 243 | #define platform_create_bundle(driver, probe, res, n_res, data, size) \ |
244 | __platform_create_bundle(driver, probe, res, n_res, data, size, THIS_MODULE) | ||
245 | extern struct platform_device *__platform_create_bundle( | ||
244 | struct platform_driver *driver, int (*probe)(struct platform_device *), | 246 | struct platform_driver *driver, int (*probe)(struct platform_device *), |
245 | struct resource *res, unsigned int n_res, | 247 | struct resource *res, unsigned int n_res, |
246 | const void *data, size_t size); | 248 | const void *data, size_t size, struct module *module); |
247 | 249 | ||
248 | /* early platform driver interface */ | 250 | /* early platform driver interface */ |
249 | struct early_platform_driver { | 251 | struct early_platform_driver { |