diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-10-17 21:17:42 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-10-17 21:17:42 -0700 |
commit | 5c45708352a040f19caceb683c78bc86aad466f6 (patch) | |
tree | 6541789a623c189c1e91ffd91bd972cad938d130 /drivers/of | |
parent | 7b96dc023a1b487bce59256fde14b8bb28b45aea (diff) | |
download | linux-5c45708352a040f19caceb683c78bc86aad466f6.tar.gz linux-5c45708352a040f19caceb683c78bc86aad466f6.tar.bz2 linux-5c45708352a040f19caceb683c78bc86aad466f6.zip |
[SPARC/64]: Consolidate of_register_driver
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>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/platform.c | 21 |
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 @@ * */ #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); |