diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_sysfs.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index 205b9f8056e2..b4561c86e230 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c | |||
@@ -290,6 +290,7 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, | |||
290 | struct zfcp_unit *unit; | 290 | struct zfcp_unit *unit; |
291 | u64 fcp_lun; | 291 | u64 fcp_lun; |
292 | int retval = -EINVAL; | 292 | int retval = -EINVAL; |
293 | struct scsi_device *sdev; | ||
293 | 294 | ||
294 | if (!(port && get_device(&port->dev))) | 295 | if (!(port && get_device(&port->dev))) |
295 | return -EBUSY; | 296 | return -EBUSY; |
@@ -303,8 +304,13 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, | |||
303 | else | 304 | else |
304 | retval = 0; | 305 | retval = 0; |
305 | 306 | ||
306 | /* wait for possible timeout during SCSI probe */ | 307 | sdev = scsi_device_lookup(port->adapter->scsi_host, 0, |
307 | flush_work(&unit->scsi_work); | 308 | port->starget_id, |
309 | scsilun_to_int((struct scsi_lun *)&fcp_lun)); | ||
310 | if (sdev) { | ||
311 | scsi_remove_device(sdev); | ||
312 | scsi_device_put(sdev); | ||
313 | } | ||
308 | 314 | ||
309 | write_lock_irq(&port->unit_list_lock); | 315 | write_lock_irq(&port->unit_list_lock); |
310 | list_del(&unit->list); | 316 | list_del(&unit->list); |