]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SPARC/64]: Consolidate of_register_driver
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 18 Oct 2007 04:17:42 +0000 (21:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2007 04:17:42 +0000 (21:17 -0700)
Also of_unregister_driver.  These will be shortly also used by the
PowerPC code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/of_device.c
arch/sparc64/kernel/of_device.c
drivers/of/platform.c
include/asm-sparc/of_platform.h
include/asm-sparc64/of_platform.h
include/linux/of_platform.h

index fb2caef79cec407f0e36497567902c88c88b2418..3ea000d15e3a29b8d7273e7aad0e53667356e5df 100644 (file)
@@ -585,24 +585,6 @@ static int __init of_debug(char *str)
 
 __setup("of_debug=", of_debug);
 
-int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
-{
-       /* initialize common driver fields */
-       if (!drv->driver.name)
-               drv->driver.name = drv->name;
-       if (!drv->driver.owner)
-               drv->driver.owner = drv->owner;
-       drv->driver.bus = bus;
-
-       /* register with core */
-       return driver_register(&drv->driver);
-}
-
-void of_unregister_driver(struct of_platform_driver *drv)
-{
-       driver_unregister(&drv->driver);
-}
-
 struct of_device* of_platform_device_create(struct device_node *np,
                                            const char *bus_id,
                                            struct device *parent,
@@ -628,6 +610,4 @@ struct of_device* of_platform_device_create(struct device_node *np,
        return dev;
 }
 
-EXPORT_SYMBOL(of_register_driver);
-EXPORT_SYMBOL(of_unregister_driver);
 EXPORT_SYMBOL(of_platform_device_create);
index 42d779866fba394135bf7063d5b6a04e29fe1c7b..fc5c0cc793b8f3a403307c9366b3be0a4fdc84da 100644 (file)
@@ -869,26 +869,6 @@ static int __init of_debug(char *str)
 
 __setup("of_debug=", of_debug);
 
-int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
-{
-       /* initialize common driver fields */
-       if (!drv->driver.name)
-               drv->driver.name = drv->name;
-       if (!drv->driver.owner)
-               drv->driver.owner = drv->owner;
-       drv->driver.bus = bus;
-
-       /* register with core */
-       return driver_register(&drv->driver);
-}
-EXPORT_SYMBOL(of_register_driver);
-
-void of_unregister_driver(struct of_platform_driver *drv)
-{
-       driver_unregister(&drv->driver);
-}
-EXPORT_SYMBOL(of_unregister_driver);
-
 struct of_device* of_platform_device_create(struct device_node *np,
                                            const char *bus_id,
                                            struct device *parent,
index 864f09fd9f86f6978d1bc87710b0fe35c48669a6..b47bb2d7476a82e5618fc50c0772cfea9ddd46ec 100644 (file)
@@ -12,6 +12,7 @@
  *
  */
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/device.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
@@ -94,3 +95,23 @@ int of_bus_type_init(struct bus_type *bus, const char *name)
        bus->resume = of_platform_device_resume;
        return bus_register(bus);
 }
+
+int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
+{
+       /* initialize common driver fields */
+       if (!drv->driver.name)
+               drv->driver.name = drv->name;
+       if (!drv->driver.owner)
+               drv->driver.owner = drv->owner;
+       drv->driver.bus = bus;
+
+       /* register with core */
+       return driver_register(&drv->driver);
+}
+EXPORT_SYMBOL(of_register_driver);
+
+void of_unregister_driver(struct of_platform_driver *drv)
+{
+       driver_unregister(&drv->driver);
+}
+EXPORT_SYMBOL(of_unregister_driver);
index 64a230064ef254c9d6aee2b797e666f0417e774a..d638737ff13c3097c97b80ec9b6469d95e431857 100644 (file)
 
 extern struct bus_type ebus_bus_type;
 extern struct bus_type sbus_bus_type;
-extern struct bus_type of_platform_bus_type;
+
 #define of_bus_type    of_platform_bus_type    /* for compatibility */
 
-extern int of_register_driver(struct of_platform_driver *drv,
-                             struct bus_type *bus);
-extern void of_unregister_driver(struct of_platform_driver *drv);
 extern struct of_device *of_platform_device_create(struct device_node *np,
                                                   const char *bus_id,
                                                   struct device *parent,
index f7c1f17c7d52bb4ced8ee5a347105cb037a502cd..f15cfa723916a3bac7180f6005a96f318b1e5d7f 100644 (file)
 extern struct bus_type isa_bus_type;
 extern struct bus_type ebus_bus_type;
 extern struct bus_type sbus_bus_type;
-extern struct bus_type of_platform_bus_type;
+
 #define of_bus_type    of_platform_bus_type    /* for compatibility */
 
-extern int of_register_driver(struct of_platform_driver *drv,
-                             struct bus_type *bus);
-extern void of_unregister_driver(struct of_platform_driver *drv);
 extern struct of_device *of_platform_device_create(struct device_node *np,
                                                   const char *bus_id,
                                                   struct device *parent,
index 448f70b30a0c81fd2148b0b04bbe150bec69e60c..a8efcfeea7323365b65ac3b6098e053af3f14de7 100644 (file)
@@ -48,6 +48,10 @@ struct of_platform_driver
 #define        to_of_platform_driver(drv) \
        container_of(drv,struct of_platform_driver, driver)
 
+extern int of_register_driver(struct of_platform_driver *drv,
+                             struct bus_type *bus);
+extern void of_unregister_driver(struct of_platform_driver *drv);
+
 #include <asm/of_platform.h>
 
 extern struct of_device *of_find_device_by_node(struct device_node *np);