diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-15 03:32:39 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:15:50 -0500 |
commit | 5f2a71fcb7995633b335a1e380ac63a968e61320 (patch) | |
tree | d47f4227d314fc9f298b75c217fa78440004e6e7 /drivers/scsi/pcmcia | |
parent | 1de9cedfbdff1d8adb662cd3afc5bda66e393351 (diff) |
[PATCH] pcmcia: add pcmcia_disable_device
pcmcia_disable_device(struct pcmcia_device *p_dev) performs the necessary
cleanups upon device or driver removal: it calls the appropriate
pcmcia_release_* functions, and can replace (most) of the current drivers'
_release() functions.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia')
-rw-r--r-- | drivers/scsi/pcmcia/aha152x_stub.c | 8 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/fdomain_stub.c | 17 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.c | 11 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/qlogic_stub.c | 9 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 8 |
5 files changed, 11 insertions, 42 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 5609847e254a..e7f9d26a0d7c 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c | |||
@@ -248,13 +248,7 @@ static void aha152x_release_cs(dev_link_t *link) | |||
248 | scsi_info_t *info = link->priv; | 248 | scsi_info_t *info = link->priv; |
249 | 249 | ||
250 | aha152x_release(info->host); | 250 | aha152x_release(info->host); |
251 | link->dev = NULL; | 251 | pcmcia_disable_device(link->handle); |
252 | |||
253 | pcmcia_release_configuration(link->handle); | ||
254 | pcmcia_release_io(link->handle, &link->io); | ||
255 | pcmcia_release_irq(link->handle, &link->irq); | ||
256 | |||
257 | link->state &= ~DEV_CONFIG; | ||
258 | } | 252 | } |
259 | 253 | ||
260 | static int aha152x_suspend(struct pcmcia_device *dev) | 254 | static int aha152x_suspend(struct pcmcia_device *dev) |
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 788c58d805f3..fb7221cf511f 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c | |||
@@ -209,20 +209,13 @@ cs_failed: | |||
209 | 209 | ||
210 | static void fdomain_release(dev_link_t *link) | 210 | static void fdomain_release(dev_link_t *link) |
211 | { | 211 | { |
212 | scsi_info_t *info = link->priv; | 212 | scsi_info_t *info = link->priv; |
213 | |||
214 | DEBUG(0, "fdomain_release(0x%p)\n", link); | ||
215 | |||
216 | scsi_remove_host(info->host); | ||
217 | link->dev = NULL; | ||
218 | |||
219 | pcmcia_release_configuration(link->handle); | ||
220 | pcmcia_release_io(link->handle, &link->io); | ||
221 | pcmcia_release_irq(link->handle, &link->irq); | ||
222 | 213 | ||
223 | scsi_unregister(info->host); | 214 | DEBUG(0, "fdomain_release(0x%p)\n", link); |
224 | 215 | ||
225 | link->state &= ~DEV_CONFIG; | 216 | scsi_remove_host(info->host); |
217 | pcmcia_disable_device(link->handle); | ||
218 | scsi_unregister(info->host); | ||
226 | } | 219 | } |
227 | 220 | ||
228 | /*====================================================================*/ | 221 | /*====================================================================*/ |
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 9e3ab3fd5355..dd383c538d98 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
@@ -1974,16 +1974,9 @@ static void nsp_cs_release(dev_link_t *link) | |||
1974 | if (data != NULL) { | 1974 | if (data != NULL) { |
1975 | iounmap((void *)(data->MmioAddress)); | 1975 | iounmap((void *)(data->MmioAddress)); |
1976 | } | 1976 | } |
1977 | pcmcia_release_window(link->win); | ||
1978 | } | 1977 | } |
1979 | pcmcia_release_configuration(link->handle); | 1978 | pcmcia_disable_device(link->handle); |
1980 | if (link->io.NumPorts1) { | 1979 | |
1981 | pcmcia_release_io(link->handle, &link->io); | ||
1982 | } | ||
1983 | if (link->irq.AssignedIRQ) { | ||
1984 | pcmcia_release_irq(link->handle, &link->irq); | ||
1985 | } | ||
1986 | link->state &= ~DEV_CONFIG; | ||
1987 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2)) | 1980 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2)) |
1988 | if (info->host != NULL) { | 1981 | if (info->host != NULL) { |
1989 | scsi_host_put(info->host); | 1982 | scsi_host_put(info->host); |
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index dce7e687fd4a..70269fc10f30 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c | |||
@@ -289,6 +289,7 @@ out: | |||
289 | cs_failed: | 289 | cs_failed: |
290 | cs_error(link->handle, last_fn, last_ret); | 290 | cs_error(link->handle, last_fn, last_ret); |
291 | link->dev = NULL; | 291 | link->dev = NULL; |
292 | |||
292 | pcmcia_release_configuration(link->handle); | 293 | pcmcia_release_configuration(link->handle); |
293 | pcmcia_release_io(link->handle, &link->io); | 294 | pcmcia_release_io(link->handle, &link->io); |
294 | pcmcia_release_irq(link->handle, &link->irq); | 295 | pcmcia_release_irq(link->handle, &link->irq); |
@@ -306,17 +307,11 @@ static void qlogic_release(dev_link_t *link) | |||
306 | DEBUG(0, "qlogic_release(0x%p)\n", link); | 307 | DEBUG(0, "qlogic_release(0x%p)\n", link); |
307 | 308 | ||
308 | scsi_remove_host(info->host); | 309 | scsi_remove_host(info->host); |
309 | link->dev = NULL; | ||
310 | 310 | ||
311 | free_irq(link->irq.AssignedIRQ, info->host); | 311 | free_irq(link->irq.AssignedIRQ, info->host); |
312 | 312 | pcmcia_disable_device(link->handle); | |
313 | pcmcia_release_configuration(link->handle); | ||
314 | pcmcia_release_io(link->handle, &link->io); | ||
315 | pcmcia_release_irq(link->handle, &link->irq); | ||
316 | 313 | ||
317 | scsi_host_put(info->host); | 314 | scsi_host_put(info->host); |
318 | |||
319 | link->state &= ~DEV_CONFIG; | ||
320 | } | 315 | } |
321 | 316 | ||
322 | /*====================================================================*/ | 317 | /*====================================================================*/ |
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 3a4dd6f5b81f..42d002b6d1a5 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -550,13 +550,7 @@ SYM53C500_release(dev_link_t *link) | |||
550 | if (shost->io_port && shost->n_io_port) | 550 | if (shost->io_port && shost->n_io_port) |
551 | release_region(shost->io_port, shost->n_io_port); | 551 | release_region(shost->io_port, shost->n_io_port); |
552 | 552 | ||
553 | link->dev = NULL; | 553 | pcmcia_disable_device(link->handle); |
554 | |||
555 | pcmcia_release_configuration(link->handle); | ||
556 | pcmcia_release_io(link->handle, &link->io); | ||
557 | pcmcia_release_irq(link->handle, &link->irq); | ||
558 | |||
559 | link->state &= ~DEV_CONFIG; | ||
560 | 554 | ||
561 | scsi_host_put(shost); | 555 | scsi_host_put(shost); |
562 | } /* SYM53C500_release */ | 556 | } /* SYM53C500_release */ |