mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
of: make of_(un)register_platform_driver common code
Some drivers using of_register_platform_driver() wrapper break on sparc because the wrapper isn't in the header file. This patch moves it from Microblaze and PowerPC implementations and makes it common code. Fixes this sparc64 allmodconfig build error (at least): drivers/leds/leds-gpio.c: In function `gpio_led_init': drivers/leds/leds-gpio.c:295: error: implicit declaration of function `of_register_platform_driver' drivers/leds/leds-gpio.c: In function `gpio_led_exit': drivers/leds/leds-gpio.c:311: error: implicit declaration of function `of_unregister_platform_driver' Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net> Cc: Michal Simek <monstr@monstr.eu> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
74641f584d
commit
0763ed2355
3 changed files with 10 additions and 20 deletions
|
@ -51,6 +51,16 @@ extern int of_register_driver(struct of_platform_driver *drv,
|
|||
struct bus_type *bus);
|
||||
extern void of_unregister_driver(struct of_platform_driver *drv);
|
||||
|
||||
/* Platform drivers register/unregister */
|
||||
static inline int of_register_platform_driver(struct of_platform_driver *drv)
|
||||
{
|
||||
return of_register_driver(drv, &of_platform_bus_type);
|
||||
}
|
||||
static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
|
||||
{
|
||||
of_unregister_driver(drv);
|
||||
}
|
||||
|
||||
#include <asm/of_platform.h>
|
||||
|
||||
extern struct of_device *of_find_device_by_node(struct device_node *np);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue