|
@@ -1243,9 +1243,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
|
|
struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
|
|
struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
|
|
uint id, uint lun, void *hostdata)
|
|
uint id, uint lun, void *hostdata)
|
|
{
|
|
{
|
|
- struct scsi_device *sdev;
|
|
|
|
|
|
+ struct scsi_device *sdev = ERR_PTR(-ENODEV);
|
|
struct device *parent = &shost->shost_gendev;
|
|
struct device *parent = &shost->shost_gendev;
|
|
- int res;
|
|
|
|
struct scsi_target *starget;
|
|
struct scsi_target *starget;
|
|
|
|
|
|
starget = scsi_alloc_target(parent, channel, id);
|
|
starget = scsi_alloc_target(parent, channel, id);
|
|
@@ -1254,12 +1253,8 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
|
|
|
|
|
|
get_device(&starget->dev);
|
|
get_device(&starget->dev);
|
|
mutex_lock(&shost->scan_mutex);
|
|
mutex_lock(&shost->scan_mutex);
|
|
- if (scsi_host_scan_allowed(shost)) {
|
|
|
|
- res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1,
|
|
|
|
- hostdata);
|
|
|
|
- if (res != SCSI_SCAN_LUN_PRESENT)
|
|
|
|
- sdev = ERR_PTR(-ENODEV);
|
|
|
|
- }
|
|
|
|
|
|
+ if (scsi_host_scan_allowed(shost))
|
|
|
|
+ scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata);
|
|
mutex_unlock(&shost->scan_mutex);
|
|
mutex_unlock(&shost->scan_mutex);
|
|
scsi_target_reap(starget);
|
|
scsi_target_reap(starget);
|
|
put_device(&starget->dev);
|
|
put_device(&starget->dev);
|