Skip to content

Commit

Permalink
of: make of_(un)register_platform_driver common code
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: David S. Miller <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
glikely authored and torvalds committed May 2, 2009
1 parent 74641f5 commit 0763ed2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
10 changes: 0 additions & 10 deletions arch/microblaze/include/asm/of_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
extern struct of_device *of_platform_device_create(struct device_node *np,
const char *bus_id,
Expand Down
10 changes: 0 additions & 10 deletions arch/powerpc/include/asm/of_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
extern struct of_device *of_platform_device_create(struct device_node *np,
const char *bus_id,
Expand Down
10 changes: 10 additions & 0 deletions include/linux/of_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0763ed2

Please sign in to comment.