aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hosts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r--drivers/scsi/hosts.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 6828ca305c2a..67c4c0c3aa5e 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -128,29 +128,13 @@ int scsi_host_set_state(struct Scsi_Host *shost, enum scsi_host_state state)
128EXPORT_SYMBOL(scsi_host_set_state); 128EXPORT_SYMBOL(scsi_host_set_state);
129 129
130/** 130/**
131 * scsi_host_cancel - cancel outstanding IO to this host
132 * @shost: pointer to struct Scsi_Host
133 * recovery: recovery requested to run.
134 **/
135static void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
136{
137 struct scsi_device *sdev;
138
139 scsi_host_set_state(shost, SHOST_CANCEL);
140 shost_for_each_device(sdev, shost) {
141 scsi_device_cancel(sdev, recovery);
142 }
143 wait_event(shost->host_wait, (shost->shost_state != SHOST_RECOVERY));
144}
145
146/**
147 * scsi_remove_host - remove a scsi host 131 * scsi_remove_host - remove a scsi host
148 * @shost: a pointer to a scsi host to remove 132 * @shost: a pointer to a scsi host to remove
149 **/ 133 **/
150void scsi_remove_host(struct Scsi_Host *shost) 134void scsi_remove_host(struct Scsi_Host *shost)
151{ 135{
136 scsi_host_set_state(shost, SHOST_CANCEL);
152 scsi_forget_host(shost); 137 scsi_forget_host(shost);
153 scsi_host_cancel(shost, 0);
154 scsi_proc_host_rm(shost); 138 scsi_proc_host_rm(shost);
155 139
156 scsi_host_set_state(shost, SHOST_DEL); 140 scsi_host_set_state(shost, SHOST_DEL);