Commit 0763ed23 authored by Grant Likely's avatar Grant Likely Committed by Linus Torvalds

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: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarDavid 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 74641f58
...@@ -36,16 +36,6 @@ static const struct of_device_id of_default_bus_ids[] = { ...@@ -36,16 +36,6 @@ static const struct of_device_id of_default_bus_ids[] = {
{}, {},
}; };
/* 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);
}
/* Platform devices and busses creation */ /* Platform devices and busses creation */
extern struct of_device *of_platform_device_create(struct device_node *np, extern struct of_device *of_platform_device_create(struct device_node *np,
const char *bus_id, const char *bus_id,
......
...@@ -11,16 +11,6 @@ ...@@ -11,16 +11,6 @@
* *
*/ */
/* 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);
}
/* Platform devices and busses creation */ /* Platform devices and busses creation */
extern struct of_device *of_platform_device_create(struct device_node *np, extern struct of_device *of_platform_device_create(struct device_node *np,
const char *bus_id, const char *bus_id,
......
...@@ -51,6 +51,16 @@ extern int of_register_driver(struct of_platform_driver *drv, ...@@ -51,6 +51,16 @@ extern int of_register_driver(struct of_platform_driver *drv,
struct bus_type *bus); struct bus_type *bus);
extern void of_unregister_driver(struct of_platform_driver *drv); 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> #include <asm/of_platform.h>
extern struct of_device *of_find_device_by_node(struct device_node *np); extern struct of_device *of_find_device_by_node(struct device_node *np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment