diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-01-03 06:05:21 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-01-07 03:42:56 +0100 |
commit | 0ad0eff98fec3c940ec199047ff580abaaa5bb1a (patch) | |
tree | edbaaf6760250383f1bf45fe39e48a1422985126 /drivers/scsi/dmx3191d.c | |
parent | ncr5380: Cleanup bogus {request,release}_region() calls (diff) | |
download | linux-0ad0eff98fec3c940ec199047ff580abaaa5bb1a.tar.xz linux-0ad0eff98fec3c940ec199047ff580abaaa5bb1a.zip |
ncr5380: Introduce unbound workqueue
Allocate a work queue that will permit busy waiting and sleeping. This
means NCR5380_init() can potentially fail, so add this error path.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/dmx3191d.c')
-rw-r--r-- | drivers/scsi/dmx3191d.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c index 2c0fd7641075..db415359fee8 100644 --- a/drivers/scsi/dmx3191d.c +++ b/drivers/scsi/dmx3191d.c @@ -95,7 +95,9 @@ static int dmx3191d_probe_one(struct pci_dev *pdev, */ shost->irq = NO_IRQ; - NCR5380_init(shost, FLAG_NO_PSEUDO_DMA | FLAG_DTC3181E); + error = NCR5380_init(shost, FLAG_NO_PSEUDO_DMA | FLAG_DTC3181E); + if (error) + goto out_host_put; NCR5380_maybe_reset_bus(shost); @@ -103,11 +105,15 @@ static int dmx3191d_probe_one(struct pci_dev *pdev, error = scsi_add_host(shost, &pdev->dev); if (error) - goto out_release_region; + goto out_exit; scsi_scan_host(shost); return 0; +out_exit: + NCR5380_exit(shost); +out_host_put: + scsi_host_put(shost); out_release_region: release_region(io, DMX3191D_REGION_LEN); out_disable_device: @@ -119,15 +125,14 @@ static int dmx3191d_probe_one(struct pci_dev *pdev, static void dmx3191d_remove_one(struct pci_dev *pdev) { struct Scsi_Host *shost = pci_get_drvdata(pdev); + unsigned long io = shost->io_port; scsi_remove_host(shost); NCR5380_exit(shost); - - release_region(shost->io_port, DMX3191D_REGION_LEN); - pci_disable_device(pdev); - scsi_host_put(shost); + release_region(io, DMX3191D_REGION_LEN); + pci_disable_device(pdev); } static struct pci_device_id dmx3191d_pci_tbl[] = { |