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:
Grant Likely 2009-04-30 15:08:50 -07:00 коммит произвёл Linus Torvalds
Родитель 74641f584d
Коммит 0763ed2355
3 изменённых файлов: 10 добавлений и 20 удалений

Просмотреть файл

@ -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 @@
* *
*/ */
/* 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,
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);