aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 386e5f21e191..16fc2dd8f2f7 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -5185,28 +5185,6 @@ void ata_host_stop (struct ata_host_set *host_set)
5185 iounmap(host_set->mmio_base); 5185 iounmap(host_set->mmio_base);
5186} 5186}
5187 5187
5188
5189/**
5190 * ata_host_remove - Unregister SCSI host structure with upper layers
5191 * @ap: Port to unregister
5192 * @do_unregister: 1 if we fully unregister, 0 to just stop the port
5193 *
5194 * LOCKING:
5195 * Inherited from caller.
5196 */
5197
5198static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
5199{
5200 struct Scsi_Host *sh = ap->host;
5201
5202 DPRINTK("ENTER\n");
5203
5204 if (do_unregister)
5205 scsi_remove_host(sh);
5206
5207 ap->ops->port_stop(ap);
5208}
5209
5210/** 5188/**
5211 * ata_dev_init - Initialize an ata_device structure 5189 * ata_dev_init - Initialize an ata_device structure
5212 * @dev: Device structure to initialize 5190 * @dev: Device structure to initialize
@@ -5532,8 +5510,11 @@ int ata_device_add(const struct ata_probe_ent *ent)
5532 5510
5533err_out: 5511err_out:
5534 for (i = 0; i < count; i++) { 5512 for (i = 0; i < count; i++) {
5535 ata_host_remove(host_set->ports[i], 1); 5513 struct ata_port *ap = host_set->ports[i];
5536 scsi_host_put(host_set->ports[i]->host); 5514 if (ap) {
5515 ap->ops->port_stop(ap);
5516 scsi_host_put(ap->host);
5517 }
5537 } 5518 }
5538err_free_ret: 5519err_free_ret:
5539 kfree(host_set); 5520 kfree(host_set);
@@ -5558,7 +5539,7 @@ void ata_port_detach(struct ata_port *ap)
5558 int i; 5539 int i;
5559 5540
5560 if (!ap->ops->error_handler) 5541 if (!ap->ops->error_handler)
5561 return; 5542 goto skip_eh;
5562 5543
5563 /* tell EH we're leaving & flush EH */ 5544 /* tell EH we're leaving & flush EH */
5564 spin_lock_irqsave(ap->lock, flags); 5545 spin_lock_irqsave(ap->lock, flags);
@@ -5594,6 +5575,7 @@ void ata_port_detach(struct ata_port *ap)
5594 cancel_delayed_work(&ap->hotplug_task); 5575 cancel_delayed_work(&ap->hotplug_task);
5595 flush_workqueue(ata_aux_wq); 5576 flush_workqueue(ata_aux_wq);
5596 5577
5578 skip_eh:
5597 /* remove the associated SCSI host */ 5579 /* remove the associated SCSI host */
5598 scsi_remove_host(ap->host); 5580 scsi_remove_host(ap->host);
5599} 5581}
@@ -5662,7 +5644,7 @@ int ata_scsi_release(struct Scsi_Host *host)
5662 DPRINTK("ENTER\n"); 5644 DPRINTK("ENTER\n");
5663 5645
5664 ap->ops->port_disable(ap); 5646 ap->ops->port_disable(ap);
5665 ata_host_remove(ap, 0); 5647 ap->ops->port_stop(ap);
5666 5648
5667 DPRINTK("EXIT\n"); 5649 DPRINTK("EXIT\n");
5668 return 1; 5650 return 1;