diff options
-rw-r--r-- | arch/powerpc/include/asm/vio.h | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/vio.c | 12 | ||||
-rw-r--r-- | arch/sparc/include/asm/vio.h | 9 | ||||
-rw-r--r-- | arch/sparc/kernel/ds.c | 5 | ||||
-rw-r--r-- | arch/sparc/kernel/vio.c | 8 | ||||
-rw-r--r-- | drivers/block/sunvdc.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/ibm/ibmveth.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/sun/sunvnet.c | 5 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 7 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 7 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvstgt.c | 5 | ||||
-rw-r--r-- | drivers/tty/hvc/hvc_vio.c | 7 | ||||
-rw-r--r-- | drivers/tty/hvc/hvcs.c | 5 |
13 files changed, 44 insertions, 48 deletions
diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h index 0a290a195946..6bfd5ffe1d4f 100644 --- a/arch/powerpc/include/asm/vio.h +++ b/arch/powerpc/include/asm/vio.h | |||
@@ -69,6 +69,7 @@ struct vio_dev { | |||
69 | }; | 69 | }; |
70 | 70 | ||
71 | struct vio_driver { | 71 | struct vio_driver { |
72 | const char *name; | ||
72 | const struct vio_device_id *id_table; | 73 | const struct vio_device_id *id_table; |
73 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); | 74 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); |
74 | int (*remove)(struct vio_dev *dev); | 75 | int (*remove)(struct vio_dev *dev); |
@@ -76,10 +77,17 @@ struct vio_driver { | |||
76 | * be loaded in a CMO environment if it uses DMA. | 77 | * be loaded in a CMO environment if it uses DMA. |
77 | */ | 78 | */ |
78 | unsigned long (*get_desired_dma)(struct vio_dev *dev); | 79 | unsigned long (*get_desired_dma)(struct vio_dev *dev); |
80 | const struct dev_pm_ops *pm; | ||
79 | struct device_driver driver; | 81 | struct device_driver driver; |
80 | }; | 82 | }; |
81 | 83 | ||
82 | extern int vio_register_driver(struct vio_driver *drv); | 84 | extern int __vio_register_driver(struct vio_driver *drv, struct module *owner, |
85 | const char *mod_name); | ||
86 | /* | ||
87 | * vio_register_driver must be a macro so that KBUILD_MODNAME can be expanded | ||
88 | */ | ||
89 | #define vio_register_driver(driver) \ | ||
90 | __vio_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) | ||
83 | extern void vio_unregister_driver(struct vio_driver *drv); | 91 | extern void vio_unregister_driver(struct vio_driver *drv); |
84 | 92 | ||
85 | extern int vio_cmo_entitlement_update(size_t); | 93 | extern int vio_cmo_entitlement_update(size_t); |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index bca3fc427b45..b2f7c8480bf6 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -1159,17 +1159,21 @@ static int vio_bus_remove(struct device *dev) | |||
1159 | * vio_register_driver: - Register a new vio driver | 1159 | * vio_register_driver: - Register a new vio driver |
1160 | * @drv: The vio_driver structure to be registered. | 1160 | * @drv: The vio_driver structure to be registered. |
1161 | */ | 1161 | */ |
1162 | int vio_register_driver(struct vio_driver *viodrv) | 1162 | int __vio_register_driver(struct vio_driver *viodrv, struct module *owner, |
1163 | const char *mod_name) | ||
1163 | { | 1164 | { |
1164 | printk(KERN_DEBUG "%s: driver %s registering\n", __func__, | 1165 | pr_debug("%s: driver %s registering\n", __func__, viodrv->name); |
1165 | viodrv->driver.name); | ||
1166 | 1166 | ||
1167 | /* fill in 'struct driver' fields */ | 1167 | /* fill in 'struct driver' fields */ |
1168 | viodrv->driver.name = viodrv->name; | ||
1169 | viodrv->driver.pm = viodrv->pm; | ||
1168 | viodrv->driver.bus = &vio_bus_type; | 1170 | viodrv->driver.bus = &vio_bus_type; |
1171 | viodrv->driver.owner = owner; | ||
1172 | viodrv->driver.mod_name = mod_name; | ||
1169 | 1173 | ||
1170 | return driver_register(&viodrv->driver); | 1174 | return driver_register(&viodrv->driver); |
1171 | } | 1175 | } |
1172 | EXPORT_SYMBOL(vio_register_driver); | 1176 | EXPORT_SYMBOL(__vio_register_driver); |
1173 | 1177 | ||
1174 | /** | 1178 | /** |
1175 | * vio_unregister_driver - Remove registration of vio driver. | 1179 | * vio_unregister_driver - Remove registration of vio driver. |
diff --git a/arch/sparc/include/asm/vio.h b/arch/sparc/include/asm/vio.h index 9d83d3bcb494..432afa838861 100644 --- a/arch/sparc/include/asm/vio.h +++ b/arch/sparc/include/asm/vio.h | |||
@@ -284,6 +284,7 @@ struct vio_dev { | |||
284 | }; | 284 | }; |
285 | 285 | ||
286 | struct vio_driver { | 286 | struct vio_driver { |
287 | const char *name; | ||
287 | struct list_head node; | 288 | struct list_head node; |
288 | const struct vio_device_id *id_table; | 289 | const struct vio_device_id *id_table; |
289 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); | 290 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); |
@@ -371,7 +372,13 @@ do { if (vio->debug & VIO_DEBUG_##TYPE) \ | |||
371 | vio->vdev->channel_id, ## a); \ | 372 | vio->vdev->channel_id, ## a); \ |
372 | } while (0) | 373 | } while (0) |
373 | 374 | ||
374 | extern int vio_register_driver(struct vio_driver *drv); | 375 | extern int __vio_register_driver(struct vio_driver *drv, struct module *owner, |
376 | const char *mod_name); | ||
377 | /* | ||
378 | * vio_register_driver must be a macro so that KBUILD_MODNAME can be expanded | ||
379 | */ | ||
380 | #define vio_register_driver(driver) \ | ||
381 | __vio_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) | ||
375 | extern void vio_unregister_driver(struct vio_driver *drv); | 382 | extern void vio_unregister_driver(struct vio_driver *drv); |
376 | 383 | ||
377 | static inline struct vio_driver *to_vio_driver(struct device_driver *drv) | 384 | static inline struct vio_driver *to_vio_driver(struct device_driver *drv) |
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 381edcd5bc29..fea13c7b1aee 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c | |||
@@ -1244,10 +1244,7 @@ static struct vio_driver ds_driver = { | |||
1244 | .id_table = ds_match, | 1244 | .id_table = ds_match, |
1245 | .probe = ds_probe, | 1245 | .probe = ds_probe, |
1246 | .remove = ds_remove, | 1246 | .remove = ds_remove, |
1247 | .driver = { | 1247 | .name = "ds", |
1248 | .name = "ds", | ||
1249 | .owner = THIS_MODULE, | ||
1250 | } | ||
1251 | }; | 1248 | }; |
1252 | 1249 | ||
1253 | static int __init ds_init(void) | 1250 | static int __init ds_init(void) |
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 | { |
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index 48e8fee9f2d4..9dcf76a10bb6 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c | |||
@@ -839,10 +839,7 @@ static struct vio_driver vdc_port_driver = { | |||
839 | .id_table = vdc_port_match, | 839 | .id_table = vdc_port_match, |
840 | .probe = vdc_port_probe, | 840 | .probe = vdc_port_probe, |
841 | .remove = vdc_port_remove, | 841 | .remove = vdc_port_remove, |
842 | .driver = { | 842 | .name = "vdc_port", |
843 | .name = "vdc_port", | ||
844 | .owner = THIS_MODULE, | ||
845 | } | ||
846 | }; | 843 | }; |
847 | 844 | ||
848 | static int __init vdc_init(void) | 845 | static int __init vdc_init(void) |
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index e877371680a9..9010cea68bc3 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c | |||
@@ -1616,11 +1616,8 @@ static struct vio_driver ibmveth_driver = { | |||
1616 | .probe = ibmveth_probe, | 1616 | .probe = ibmveth_probe, |
1617 | .remove = ibmveth_remove, | 1617 | .remove = ibmveth_remove, |
1618 | .get_desired_dma = ibmveth_get_desired_dma, | 1618 | .get_desired_dma = ibmveth_get_desired_dma, |
1619 | .driver = { | 1619 | .name = ibmveth_driver_name, |
1620 | .name = ibmveth_driver_name, | 1620 | .pm = &ibmveth_pm_ops, |
1621 | .owner = THIS_MODULE, | ||
1622 | .pm = &ibmveth_pm_ops, | ||
1623 | } | ||
1624 | }; | 1621 | }; |
1625 | 1622 | ||
1626 | static int __init ibmveth_module_init(void) | 1623 | static int __init ibmveth_module_init(void) |
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 92a037a8228a..38e3ae9155b7 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c | |||
@@ -1259,10 +1259,7 @@ static struct vio_driver vnet_port_driver = { | |||
1259 | .id_table = vnet_port_match, | 1259 | .id_table = vnet_port_match, |
1260 | .probe = vnet_port_probe, | 1260 | .probe = vnet_port_probe, |
1261 | .remove = vnet_port_remove, | 1261 | .remove = vnet_port_remove, |
1262 | .driver = { | 1262 | .name = "vnet_port", |
1263 | .name = "vnet_port", | ||
1264 | .owner = THIS_MODULE, | ||
1265 | } | ||
1266 | }; | 1263 | }; |
1267 | 1264 | ||
1268 | static int __init vnet_init(void) | 1265 | static int __init vnet_init(void) |
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index bdfa223a7dbb..134a0ae85bb7 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
@@ -4890,11 +4890,8 @@ static struct vio_driver ibmvfc_driver = { | |||
4890 | .probe = ibmvfc_probe, | 4890 | .probe = ibmvfc_probe, |
4891 | .remove = ibmvfc_remove, | 4891 | .remove = ibmvfc_remove, |
4892 | .get_desired_dma = ibmvfc_get_desired_dma, | 4892 | .get_desired_dma = ibmvfc_get_desired_dma, |
4893 | .driver = { | 4893 | .name = IBMVFC_NAME, |
4894 | .name = IBMVFC_NAME, | 4894 | .pm = &ibmvfc_pm_ops, |
4895 | .owner = THIS_MODULE, | ||
4896 | .pm = &ibmvfc_pm_ops, | ||
4897 | } | ||
4898 | }; | 4895 | }; |
4899 | 4896 | ||
4900 | static struct fc_function_template ibmvfc_transport_functions = { | 4897 | static struct fc_function_template ibmvfc_transport_functions = { |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index e984951baeb6..3a6c4742951e 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -2061,11 +2061,8 @@ static struct vio_driver ibmvscsi_driver = { | |||
2061 | .probe = ibmvscsi_probe, | 2061 | .probe = ibmvscsi_probe, |
2062 | .remove = ibmvscsi_remove, | 2062 | .remove = ibmvscsi_remove, |
2063 | .get_desired_dma = ibmvscsi_get_desired_dma, | 2063 | .get_desired_dma = ibmvscsi_get_desired_dma, |
2064 | .driver = { | 2064 | .name = "ibmvscsi", |
2065 | .name = "ibmvscsi", | 2065 | .pm = &ibmvscsi_pm_ops, |
2066 | .owner = THIS_MODULE, | ||
2067 | .pm = &ibmvscsi_pm_ops, | ||
2068 | } | ||
2069 | }; | 2066 | }; |
2070 | 2067 | ||
2071 | static struct srp_function_template ibmvscsi_transport_functions = { | 2068 | static struct srp_function_template ibmvscsi_transport_functions = { |
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c index 2256babe0474..aa7ed81e9237 100644 --- a/drivers/scsi/ibmvscsi/ibmvstgt.c +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c | |||
@@ -918,10 +918,7 @@ static struct vio_driver ibmvstgt_driver = { | |||
918 | .id_table = ibmvstgt_device_table, | 918 | .id_table = ibmvstgt_device_table, |
919 | .probe = ibmvstgt_probe, | 919 | .probe = ibmvstgt_probe, |
920 | .remove = ibmvstgt_remove, | 920 | .remove = ibmvstgt_remove, |
921 | .driver = { | 921 | .name = "ibmvscsis", |
922 | .name = "ibmvscsis", | ||
923 | .owner = THIS_MODULE, | ||
924 | } | ||
925 | }; | 922 | }; |
926 | 923 | ||
927 | static int get_system_info(void) | 924 | static int get_system_info(void) |
diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c index 3a0d53d6368f..ee307799271a 100644 --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c | |||
@@ -310,11 +310,8 @@ static int __devexit hvc_vio_remove(struct vio_dev *vdev) | |||
310 | static struct vio_driver hvc_vio_driver = { | 310 | static struct vio_driver hvc_vio_driver = { |
311 | .id_table = hvc_driver_table, | 311 | .id_table = hvc_driver_table, |
312 | .probe = hvc_vio_probe, | 312 | .probe = hvc_vio_probe, |
313 | .remove = __devexit_p(hvc_vio_remove), | 313 | .remove = hvc_vio_remove, |
314 | .driver = { | 314 | .name = hvc_driver_name, |
315 | .name = hvc_driver_name, | ||
316 | .owner = THIS_MODULE, | ||
317 | } | ||
318 | }; | 315 | }; |
319 | 316 | ||
320 | static int __init hvc_vio_init(void) | 317 | static int __init hvc_vio_init(void) |
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index d23759183b47..3436436fe2d7 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c | |||
@@ -879,10 +879,7 @@ static struct vio_driver hvcs_vio_driver = { | |||
879 | .id_table = hvcs_driver_table, | 879 | .id_table = hvcs_driver_table, |
880 | .probe = hvcs_probe, | 880 | .probe = hvcs_probe, |
881 | .remove = __devexit_p(hvcs_remove), | 881 | .remove = __devexit_p(hvcs_remove), |
882 | .driver = { | 882 | .name = hvcs_driver_name, |
883 | .name = hvcs_driver_name, | ||
884 | .owner = THIS_MODULE, | ||
885 | } | ||
886 | }; | 883 | }; |
887 | 884 | ||
888 | /* Only called from hvcs_get_pi please */ | 885 | /* Only called from hvcs_get_pi please */ |