aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_sysfs.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 8d2312239ae0..f5ace2bfc6db 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1110,7 +1110,9 @@ void __scsi_remove_device(struct scsi_device *sdev)
1110 device_unregister(&sdev->sdev_dev); 1110 device_unregister(&sdev->sdev_dev);
1111 transport_remove_device(dev); 1111 transport_remove_device(dev);
1112 scsi_dh_remove_device(sdev); 1112 scsi_dh_remove_device(sdev);
1113 } 1113 device_del(dev);
1114 } else
1115 put_device(&sdev->sdev_dev);
1114 1116
1115 /* 1117 /*
1116 * Stop accepting new requests and wait until all queuecommand() and 1118 * Stop accepting new requests and wait until all queuecommand() and
@@ -1121,16 +1123,6 @@ void __scsi_remove_device(struct scsi_device *sdev)
1121 blk_cleanup_queue(sdev->request_queue); 1123 blk_cleanup_queue(sdev->request_queue);
1122 cancel_work_sync(&sdev->requeue_work); 1124 cancel_work_sync(&sdev->requeue_work);
1123 1125
1124 /*
1125 * Remove the device after blk_cleanup_queue() has been called such
1126 * a possible bdi_register() call with the same name occurs after
1127 * blk_cleanup_queue() has called bdi_destroy().
1128 */
1129 if (sdev->is_visible)
1130 device_del(dev);
1131 else
1132 put_device(&sdev->sdev_dev);
1133
1134 if (sdev->host->hostt->slave_destroy) 1126 if (sdev->host->hostt->slave_destroy)
1135 sdev->host->hostt->slave_destroy(sdev); 1127 sdev->host->hostt->slave_destroy(sdev);
1136 transport_destroy_device(dev); 1128 transport_destroy_device(dev);