Skip to contentSkip to conversation

of: make of_(un)register_platform_driver common code.

PATCH In review Grant Likely 2 participants 2 messages Apr 28, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---

 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
index 187c0ee..3749127 100644
@@ -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
index 53b4650..d4aaa34 100644
@@ -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
index 3d327b6..9084066 100644
@@ -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);
#1 lore raw
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.