aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/ds.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 749c2a16012c..249b8895807d 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
160static void
161pcmcia_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);
204void pcmcia_unregister_driver(struct pcmcia_driver *driver) 206void 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}