aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/vio.h10
-rw-r--r--arch/powerpc/kernel/vio.c12
-rw-r--r--arch/sparc/include/asm/vio.h9
-rw-r--r--arch/sparc/kernel/ds.c5
-rw-r--r--arch/sparc/kernel/vio.c8
-rw-r--r--drivers/block/sunvdc.c5
-rw-r--r--drivers/net/ethernet/ibm/ibmveth.c7
-rw-r--r--drivers/net/ethernet/sun/sunvnet.c5
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c7
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c7
-rw-r--r--drivers/scsi/ibmvscsi/ibmvstgt.c5
-rw-r--r--drivers/tty/hvc/hvc_vio.c7
-rw-r--r--drivers/tty/hvc/hvcs.c5
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
71struct vio_driver { 71struct 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
82extern int vio_register_driver(struct vio_driver *drv); 84extern 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)
83extern void vio_unregister_driver(struct vio_driver *drv); 91extern void vio_unregister_driver(struct vio_driver *drv);
84 92
85extern int vio_cmo_entitlement_update(size_t); 93extern 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 */
1162int vio_register_driver(struct vio_driver *viodrv) 1162int __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}
1172EXPORT_SYMBOL(vio_register_driver); 1176EXPORT_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
286struct vio_driver { 286struct 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
374extern int vio_register_driver(struct vio_driver *drv); 375extern 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)
375extern void vio_unregister_driver(struct vio_driver *drv); 382extern void vio_unregister_driver(struct vio_driver *drv);
376 383
377static inline struct vio_driver *to_vio_driver(struct device_driver *drv) 384static 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
1253static int __init ds_init(void) 1250static 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
122int vio_register_driver(struct vio_driver *viodrv) 122int __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}
128EXPORT_SYMBOL(vio_register_driver); 132EXPORT_SYMBOL(__vio_register_driver);
129 133
130void vio_unregister_driver(struct vio_driver *viodrv) 134void 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
848static int __init vdc_init(void) 845static 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
1626static int __init ibmveth_module_init(void) 1623static 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
1268static int __init vnet_init(void) 1265static 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
4900static struct fc_function_template ibmvfc_transport_functions = { 4897static 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
2071static struct srp_function_template ibmvscsi_transport_functions = { 2068static 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
927static int get_system_info(void) 924static 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)
310static struct vio_driver hvc_vio_driver = { 310static 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
320static int __init hvc_vio_init(void) 317static 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 */