aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/platform.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 864f09fd9f86..b47bb2d7476a 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -12,6 +12,7 @@
12 * 12 *
13 */ 13 */
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/module.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/of_device.h> 17#include <linux/of_device.h>
17#include <linux/of_platform.h> 18#include <linux/of_platform.h>
@@ -94,3 +95,23 @@ int of_bus_type_init(struct bus_type *bus, const char *name)
94 bus->resume = of_platform_device_resume; 95 bus->resume = of_platform_device_resume;
95 return bus_register(bus); 96 return bus_register(bus);
96} 97}
98
99int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
100{
101 /* initialize common driver fields */
102 if (!drv->driver.name)
103 drv->driver.name = drv->name;
104 if (!drv->driver.owner)
105 drv->driver.owner = drv->owner;
106 drv->driver.bus = bus;
107
108 /* register with core */
109 return driver_register(&drv->driver);
110}
111EXPORT_SYMBOL(of_register_driver);
112
113void of_unregister_driver(struct of_platform_driver *drv)
114{
115 driver_unregister(&drv->driver);
116}
117EXPORT_SYMBOL(of_unregister_driver);