aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-08-08 05:36:26 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-09-29 11:20:24 -0400
commit2e9b981a7c63ee8278df6823f8389d69dad1a499 (patch)
tree7d88e2a03a3202ba26ce7dbcf6909e28d44f690c /drivers/pcmcia/ds.c
parent1cc745d1cdca8086b472a06671f0830fc0e98861 (diff)
pcmcia: move driver name to struct pcmcia_driver
Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 912c74082891..100c4412457d 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -51,7 +51,7 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
51 51
52 if (!p_drv->probe || !p_drv->remove) 52 if (!p_drv->probe || !p_drv->remove)
53 printk(KERN_DEBUG "pcmcia: %s lacks a requisite callback " 53 printk(KERN_DEBUG "pcmcia: %s lacks a requisite callback "
54 "function\n", p_drv->drv.name); 54 "function\n", p_drv->name);
55 55
56 while (did && did->match_flags) { 56 while (did && did->match_flags) {
57 for (i = 0; i < 4; i++) { 57 for (i = 0; i < 4; i++) {
@@ -64,7 +64,7 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
64 64
65 printk(KERN_DEBUG "pcmcia: %s: invalid hash for " 65 printk(KERN_DEBUG "pcmcia: %s: invalid hash for "
66 "product string \"%s\": is 0x%x, should " 66 "product string \"%s\": is 0x%x, should "
67 "be 0x%x\n", p_drv->drv.name, did->prod_id[i], 67 "be 0x%x\n", p_drv->name, did->prod_id[i],
68 did->prod_id_hash[i], hash); 68 did->prod_id_hash[i], hash);
69 printk(KERN_DEBUG "pcmcia: see " 69 printk(KERN_DEBUG "pcmcia: see "
70 "Documentation/pcmcia/devicetable.txt for " 70 "Documentation/pcmcia/devicetable.txt for "
@@ -179,10 +179,11 @@ int pcmcia_register_driver(struct pcmcia_driver *driver)
179 /* initialize common fields */ 179 /* initialize common fields */
180 driver->drv.bus = &pcmcia_bus_type; 180 driver->drv.bus = &pcmcia_bus_type;
181 driver->drv.owner = driver->owner; 181 driver->drv.owner = driver->owner;
182 driver->drv.name = driver->name;
182 mutex_init(&driver->dynids.lock); 183 mutex_init(&driver->dynids.lock);
183 INIT_LIST_HEAD(&driver->dynids.list); 184 INIT_LIST_HEAD(&driver->dynids.list);
184 185
185 pr_debug("registering driver %s\n", driver->drv.name); 186 pr_debug("registering driver %s\n", driver->name);
186 187
187 error = driver_register(&driver->drv); 188 error = driver_register(&driver->drv);
188 if (error < 0) 189 if (error < 0)
@@ -202,7 +203,7 @@ EXPORT_SYMBOL(pcmcia_register_driver);
202 */ 203 */
203void pcmcia_unregister_driver(struct pcmcia_driver *driver) 204void pcmcia_unregister_driver(struct pcmcia_driver *driver)
204{ 205{
205 pr_debug("unregistering driver %s\n", driver->drv.name); 206 pr_debug("unregistering driver %s\n", driver->name);
206 driver_unregister(&driver->drv); 207 driver_unregister(&driver->drv);
207 pcmcia_free_dynids(driver); 208 pcmcia_free_dynids(driver);
208} 209}
@@ -263,7 +264,7 @@ static int pcmcia_device_probe(struct device *dev)
263 p_drv = to_pcmcia_drv(dev->driver); 264 p_drv = to_pcmcia_drv(dev->driver);
264 s = p_dev->socket; 265 s = p_dev->socket;
265 266
266 dev_dbg(dev, "trying to bind to %s\n", p_drv->drv.name); 267 dev_dbg(dev, "trying to bind to %s\n", p_drv->name);
267 268
268 if ((!p_drv->probe) || (!p_dev->function_config) || 269 if ((!p_drv->probe) || (!p_dev->function_config) ||
269 (!try_module_get(p_drv->owner))) { 270 (!try_module_get(p_drv->owner))) {
@@ -289,10 +290,10 @@ static int pcmcia_device_probe(struct device *dev)
289 ret = p_drv->probe(p_dev); 290 ret = p_drv->probe(p_dev);
290 if (ret) { 291 if (ret) {
291 dev_dbg(dev, "binding to %s failed with %d\n", 292 dev_dbg(dev, "binding to %s failed with %d\n",
292 p_drv->drv.name, ret); 293 p_drv->name, ret);
293 goto put_module; 294 goto put_module;
294 } 295 }
295 dev_dbg(dev, "%s bound: Vpp %d.%d, idx %x, IRQ %d", p_drv->drv.name, 296 dev_dbg(dev, "%s bound: Vpp %d.%d, idx %x, IRQ %d", p_drv->name,
296 p_dev->vpp/10, p_dev->vpp%10, p_dev->config_index, p_dev->irq); 297 p_dev->vpp/10, p_dev->vpp%10, p_dev->config_index, p_dev->irq);
297 dev_dbg(dev, "resources: ioport %pR %pR iomem %pR %pR %pR", 298 dev_dbg(dev, "resources: ioport %pR %pR iomem %pR %pR %pR",
298 p_dev->resource[0], p_dev->resource[1], p_dev->resource[2], 299 p_dev->resource[0], p_dev->resource[1], p_dev->resource[2],
@@ -380,13 +381,13 @@ static int pcmcia_device_remove(struct device *dev)
380 if (p_dev->_irq || p_dev->_io || p_dev->_locked) 381 if (p_dev->_irq || p_dev->_io || p_dev->_locked)
381 dev_printk(KERN_INFO, dev, 382 dev_printk(KERN_INFO, dev,
382 "pcmcia: driver %s did not release config properly\n", 383 "pcmcia: driver %s did not release config properly\n",
383 p_drv->drv.name); 384 p_drv->name);
384 385
385 for (i = 0; i < MAX_WIN; i++) 386 for (i = 0; i < MAX_WIN; i++)
386 if (p_dev->_win & CLIENT_WIN_REQ(i)) 387 if (p_dev->_win & CLIENT_WIN_REQ(i))
387 dev_printk(KERN_INFO, dev, 388 dev_printk(KERN_INFO, dev,
388 "pcmcia: driver %s did not release window properly\n", 389 "pcmcia: driver %s did not release window properly\n",
389 p_drv->drv.name); 390 p_drv->name);
390 391
391 /* references from pcmcia_probe_device */ 392 /* references from pcmcia_probe_device */
392 pcmcia_put_dev(p_dev); 393 pcmcia_put_dev(p_dev);
@@ -1142,7 +1143,7 @@ static int pcmcia_dev_suspend(struct device *dev, pm_message_t state)
1142 dev_printk(KERN_ERR, dev, 1143 dev_printk(KERN_ERR, dev,
1143 "pcmcia: device %s (driver %s) did " 1144 "pcmcia: device %s (driver %s) did "
1144 "not want to go to sleep (%d)\n", 1145 "not want to go to sleep (%d)\n",
1145 p_dev->devname, p_drv->drv.name, ret); 1146 p_dev->devname, p_drv->name, ret);
1146 mutex_lock(&p_dev->socket->ops_mutex); 1147 mutex_lock(&p_dev->socket->ops_mutex);
1147 p_dev->suspended = 0; 1148 p_dev->suspended = 0;
1148 mutex_unlock(&p_dev->socket->ops_mutex); 1149 mutex_unlock(&p_dev->socket->ops_mutex);