aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index dfdbbd008630..803c7b9690c5 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1243,9 +1243,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1243struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, 1243struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
1244 uint id, uint lun, void *hostdata) 1244 uint id, uint lun, void *hostdata)
1245{ 1245{
1246 struct scsi_device *sdev; 1246 struct scsi_device *sdev = ERR_PTR(-ENODEV);
1247 struct device *parent = &shost->shost_gendev; 1247 struct device *parent = &shost->shost_gendev;
1248 int res;
1249 struct scsi_target *starget; 1248 struct scsi_target *starget;
1250 1249
1251 starget = scsi_alloc_target(parent, channel, id); 1250 starget = scsi_alloc_target(parent, channel, id);
@@ -1254,12 +1253,8 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
1254 1253
1255 get_device(&starget->dev); 1254 get_device(&starget->dev);
1256 mutex_lock(&shost->scan_mutex); 1255 mutex_lock(&shost->scan_mutex);
1257 if (scsi_host_scan_allowed(shost)) { 1256 if (scsi_host_scan_allowed(shost))
1258 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, 1257 scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata);
1259 hostdata);
1260 if (res != SCSI_SCAN_LUN_PRESENT)
1261 sdev = ERR_PTR(-ENODEV);
1262 }
1263 mutex_unlock(&shost->scan_mutex); 1258 mutex_unlock(&shost->scan_mutex);
1264 scsi_target_reap(starget); 1259 scsi_target_reap(starget);
1265 put_device(&starget->dev); 1260 put_device(&starget->dev);