summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/vio.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-26 21:06:30 +0200
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-28 02:33:24 +0200
commitcb52d8970eee65bf2c47d9a91bd4f58b17f595f4 (patch)
tree43521ba99805f293e09a284901cb5435afeab789 /arch/sparc/kernel/vio.c
parentpowerpc: Random little legacy iSeries removal tidy ups (diff)
downloadlinux-cb52d8970eee65bf2c47d9a91bd4f58b17f595f4.tar.xz
linux-cb52d8970eee65bf2c47d9a91bd4f58b17f595f4.zip
powerpc+sparc/vio: Modernize driver registration
This makes vio_register_driver() get the module owner & name at compile time like PCI drivers do, and adds a name pointer directly in struct vio_driver to avoid having to explicitly initialize the embedded struct device. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/vio.c')
-rw-r--r--arch/sparc/kernel/vio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index f67e28ef598c..5cffdc55f075 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -119,13 +119,17 @@ static struct bus_type vio_bus_type = {
.remove = vio_device_remove,
};
-int vio_register_driver(struct vio_driver *viodrv)
+int __vio_register_driver(struct vio_driver *viodrv, struct module *owner,
+ const char *mod_name)
{
viodrv->driver.bus = &vio_bus_type;
+ viodrv->driver.name = viodrv->name;
+ viodrv->driver.owner = owner;
+ viodrv->driver.mod_name = mod_name;
return driver_register(&viodrv->driver);
}
-EXPORT_SYMBOL(vio_register_driver);
+EXPORT_SYMBOL(__vio_register_driver);
void vio_unregister_driver(struct vio_driver *viodrv)
{