of: make of_(un)register_platform_driver common code.
Subsystems (3)
PATCH 1/1 of: make of_(un)register_platform_driver common code.
From: Grant Likely <[email protected]>
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.
Signed-off-by Grant Likely <[email protected]>
Acked-by David S. Miller <[email protected]>
---
arch/microblaze/include/asm/of_platform.h | 10 ---------- arch/powerpc/include/asm/of_platform.h | 10 ---------- include/linux/of_platform.h | 10 ++++++++++ 3 files changed, 10 insertions(+), 20 deletions(-)
arch/microblaze/include/asm/of_platform.h +0 -10
@@ -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,
arch/powerpc/include/asm/of_platform.h +0 -10
@@ -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,
include/linux/of_platform.h +10 -0
@@ -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);
Quoted 3 lines · On Tue, 28 Apr 2009 07:58:26 -0600 Grant Likely <[email protected]>…
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.
Thanks. I'll plan to merge this into mainline later in the week.