core: platform: let platform_driver_probe initialize module owner
authorWolfram Sang <wsa@the-dreams.de>
Tue, 28 Oct 2014 16:40:41 +0000 (17:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Nov 2014 23:16:02 +0000 (15:16 -0800)
commitc3b50dc219e1437e4dcb6a1639b004648dc29faa
treefe43f3dc0559b9a4c4f835c88504fa157fdf2869
parent161d6981096f5700ff5a2618bc9337c157eb717a
core: platform: let platform_driver_probe 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_driver_probe() which uses it 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>
drivers/base/platform.c
include/linux/platform_device.h