[POWERPC] Use of_register_driver to implement of_register_platform_driver
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 17 Oct 2007 03:43:34 +0000 (13:43 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 11 Dec 2007 02:34:39 +0000 (13:34 +1100)
Also use of_unregister_driver to implement of_unregister_platform_driver.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/of_platform.c
include/asm-powerpc/of_platform.h

index aeaa20268ce2deef9b93d137b5d8148f334327f3..79c04d151ddbf52631199d0aa0baa328afed1d73 100644 (file)
@@ -64,26 +64,6 @@ static int __init of_bus_driver_init(void)
 
 postcore_initcall(of_bus_driver_init);
 
-int of_register_platform_driver(struct of_platform_driver *drv)
-{
-       /* 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 = &of_platform_bus_type;
-
-       /* register with core */
-       return driver_register(&drv->driver);
-}
-EXPORT_SYMBOL(of_register_platform_driver);
-
-void of_unregister_platform_driver(struct of_platform_driver *drv)
-{
-       driver_unregister(&drv->driver);
-}
-EXPORT_SYMBOL(of_unregister_platform_driver);
-
 struct of_device* of_platform_device_create(struct device_node *np,
                                            const char *bus_id,
                                            struct device *parent)
index 80e6fad28b4fdb7762d93cef14296c59b875a149..d20a4cd08fa1a928fca2e4307552c0e6031c2bb9 100644 (file)
 #include <linux/of_platform.h>
 
 /* Platform drivers register/unregister */
-extern int of_register_platform_driver(struct of_platform_driver *drv);
-extern void of_unregister_platform_driver(struct of_platform_driver *drv);
+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,