diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/ds.c | 15 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_base.c | 12 | ||||
-rw-r--r-- | drivers/pcmcia/sa1111_generic.c | 3 |
3 files changed, 13 insertions, 17 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 749c2a16012c..079629bff957 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -127,10 +127,7 @@ pcmcia_store_new_id(struct device_driver *driver, const char *buf, size_t count) | |||
127 | list_add_tail(&dynid->node, &pdrv->dynids.list); | 127 | list_add_tail(&dynid->node, &pdrv->dynids.list); |
128 | mutex_unlock(&pdrv->dynids.lock); | 128 | mutex_unlock(&pdrv->dynids.lock); |
129 | 129 | ||
130 | if (get_driver(&pdrv->drv)) { | 130 | retval = driver_attach(&pdrv->drv); |
131 | retval = driver_attach(&pdrv->drv); | ||
132 | put_driver(&pdrv->drv); | ||
133 | } | ||
134 | 131 | ||
135 | if (retval) | 132 | if (retval) |
136 | return retval; | 133 | return retval; |
@@ -160,6 +157,11 @@ pcmcia_create_newid_file(struct pcmcia_driver *drv) | |||
160 | return error; | 157 | return error; |
161 | } | 158 | } |
162 | 159 | ||
160 | static void | ||
161 | pcmcia_remove_newid_file(struct pcmcia_driver *drv) | ||
162 | { | ||
163 | driver_remove_file(&drv->drv, &driver_attr_new_id); | ||
164 | } | ||
163 | 165 | ||
164 | /** | 166 | /** |
165 | * pcmcia_register_driver - register a PCMCIA driver with the bus core | 167 | * pcmcia_register_driver - register a PCMCIA driver with the bus core |
@@ -204,6 +206,7 @@ EXPORT_SYMBOL(pcmcia_register_driver); | |||
204 | void pcmcia_unregister_driver(struct pcmcia_driver *driver) | 206 | void pcmcia_unregister_driver(struct pcmcia_driver *driver) |
205 | { | 207 | { |
206 | pr_debug("unregistering driver %s\n", driver->name); | 208 | pr_debug("unregistering driver %s\n", driver->name); |
209 | pcmcia_remove_newid_file(driver); | ||
207 | driver_unregister(&driver->drv); | 210 | driver_unregister(&driver->drv); |
208 | pcmcia_free_dynids(driver); | 211 | pcmcia_free_dynids(driver); |
209 | } | 212 | } |
@@ -1269,10 +1272,8 @@ static int pcmcia_bus_add(struct pcmcia_socket *skt) | |||
1269 | 1272 | ||
1270 | static int pcmcia_bus_early_resume(struct pcmcia_socket *skt) | 1273 | static int pcmcia_bus_early_resume(struct pcmcia_socket *skt) |
1271 | { | 1274 | { |
1272 | if (!verify_cis_cache(skt)) { | 1275 | if (!verify_cis_cache(skt)) |
1273 | pcmcia_put_socket(skt); | ||
1274 | return 0; | 1276 | return 0; |
1275 | } | ||
1276 | 1277 | ||
1277 | dev_dbg(&skt->dev, "cis mismatch - different card\n"); | 1278 | dev_dbg(&skt->dev, "cis mismatch - different card\n"); |
1278 | 1279 | ||
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index a87e2728b2c3..64d433ec4fc6 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -328,21 +328,15 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
328 | goto err1; | 328 | goto err1; |
329 | } | 329 | } |
330 | 330 | ||
331 | if (ret) { | 331 | pxa2xx_configure_sockets(&dev->dev); |
332 | while (--i >= 0) | 332 | dev_set_drvdata(&dev->dev, sinfo); |
333 | soc_pcmcia_remove_one(&sinfo->skt[i]); | ||
334 | kfree(sinfo); | ||
335 | clk_put(clk); | ||
336 | } else { | ||
337 | pxa2xx_configure_sockets(&dev->dev); | ||
338 | dev_set_drvdata(&dev->dev, sinfo); | ||
339 | } | ||
340 | 333 | ||
341 | return 0; | 334 | return 0; |
342 | 335 | ||
343 | err1: | 336 | err1: |
344 | while (--i >= 0) | 337 | while (--i >= 0) |
345 | soc_pcmcia_remove_one(&sinfo->skt[i]); | 338 | soc_pcmcia_remove_one(&sinfo->skt[i]); |
339 | clk_put(clk); | ||
346 | kfree(sinfo); | 340 | kfree(sinfo); |
347 | err0: | 341 | err0: |
348 | return ret; | 342 | return ret; |
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index 59866905ea37..27f2fe3b7fb4 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c | |||
@@ -205,7 +205,8 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev) | |||
205 | 205 | ||
206 | dev_set_drvdata(&dev->dev, NULL); | 206 | dev_set_drvdata(&dev->dev, NULL); |
207 | 207 | ||
208 | for (; next = s->next, s; s = next) { | 208 | for (; s; s = next) { |
209 | next = s->next; | ||
209 | soc_pcmcia_remove_one(&s->soc); | 210 | soc_pcmcia_remove_one(&s->soc); |
210 | kfree(s); | 211 | kfree(s); |
211 | } | 212 | } |