]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/of_device.c
Merge branch 'from-linus' into upstream
[karo-tx-linux.git] / arch / powerpc / kernel / of_device.c
index 766718814515a4bf1b07cf5aa38856ab572f59e0..9feeeef5a87535a298b90e95f145b4664862277f 100644 (file)
@@ -4,6 +4,8 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/mod_devicetable.h>
+#include <linux/slab.h>
+
 #include <asm/errno.h>
 #include <asm/of_device.h>
 
@@ -130,6 +132,8 @@ static int of_device_resume(struct device * dev)
 struct bus_type of_platform_bus_type = {
        .name   = "of_platform",
        .match  = of_platform_bus_match,
+       .probe  = of_device_probe,
+       .remove = of_device_remove,
        .suspend        = of_device_suspend,
        .resume = of_device_resume,
 };
@@ -143,17 +147,12 @@ postcore_initcall(of_bus_driver_init);
 
 int of_register_driver(struct of_platform_driver *drv)
 {
-       int count = 0;
-
        /* initialize common driver fields */
        drv->driver.name = drv->name;
        drv->driver.bus = &of_platform_bus_type;
-       drv->driver.probe = of_device_probe;
-       drv->driver.remove = of_device_remove;
 
        /* register with core */
-       count = driver_register(&drv->driver);
-       return count ? count : 1;
+       return driver_register(&drv->driver);
 }
 
 void of_unregister_driver(struct of_platform_driver *drv)