diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-26 15:06:30 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-27 20:33:24 -0400 |
commit | cb52d8970eee65bf2c47d9a91bd4f58b17f595f4 (patch) | |
tree | 43521ba99805f293e09a284901cb5435afeab789 /arch/sparc/kernel/vio.c | |
parent | 1d9a47315042606b4217691bcea36cfa6ccbde66 (diff) |
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.c | 8 |
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 = { | |||
119 | .remove = vio_device_remove, | 119 | .remove = vio_device_remove, |
120 | }; | 120 | }; |
121 | 121 | ||
122 | int vio_register_driver(struct vio_driver *viodrv) | 122 | int __vio_register_driver(struct vio_driver *viodrv, struct module *owner, |
123 | const char *mod_name) | ||
123 | { | 124 | { |
124 | viodrv->driver.bus = &vio_bus_type; | 125 | viodrv->driver.bus = &vio_bus_type; |
126 | viodrv->driver.name = viodrv->name; | ||
127 | viodrv->driver.owner = owner; | ||
128 | viodrv->driver.mod_name = mod_name; | ||
125 | 129 | ||
126 | return driver_register(&viodrv->driver); | 130 | return driver_register(&viodrv->driver); |
127 | } | 131 | } |
128 | EXPORT_SYMBOL(vio_register_driver); | 132 | EXPORT_SYMBOL(__vio_register_driver); |
129 | 133 | ||
130 | void vio_unregister_driver(struct vio_driver *viodrv) | 134 | void vio_unregister_driver(struct vio_driver *viodrv) |
131 | { | 135 | { |