aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-08-28 12:18:35 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-08-28 12:18:35 -0400
commit7a93aef7fbac6f4db40b6fec5c0c6b654ae7a93c (patch)
tree4cd7aae38012dfc1ff6c62be20ef8840e56d8383 /drivers/scsi/scsi_scan.c
parent392160335c798bbe94ab3aae6ea0c85d32b81bbc (diff)
parent8224bfa84d510630b40ea460b2bb380c91acb8ae (diff)
Merge HEAD from ../scsi-misc-2.6-tmp
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index d2ca4b8fbc1..0048beaffc9 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1251,9 +1251,12 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
1251 1251
1252 get_device(&starget->dev); 1252 get_device(&starget->dev);
1253 down(&shost->scan_mutex); 1253 down(&shost->scan_mutex);
1254 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata); 1254 if (scsi_host_scan_allowed(shost)) {
1255 if (res != SCSI_SCAN_LUN_PRESENT) 1255 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1,
1256 sdev = ERR_PTR(-ENODEV); 1256 hostdata);
1257 if (res != SCSI_SCAN_LUN_PRESENT)
1258 sdev = ERR_PTR(-ENODEV);
1259 }
1257 up(&shost->scan_mutex); 1260 up(&shost->scan_mutex);
1258 scsi_target_reap(starget); 1261 scsi_target_reap(starget);
1259 put_device(&starget->dev); 1262 put_device(&starget->dev);
@@ -1403,11 +1406,15 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
1403 return -EINVAL; 1406 return -EINVAL;
1404 1407
1405 down(&shost->scan_mutex); 1408 down(&shost->scan_mutex);
1406 if (channel == SCAN_WILD_CARD) 1409 if (scsi_host_scan_allowed(shost)) {
1407 for (channel = 0; channel <= shost->max_channel; channel++) 1410 if (channel == SCAN_WILD_CARD)
1411 for (channel = 0; channel <= shost->max_channel;
1412 channel++)
1413 scsi_scan_channel(shost, channel, id, lun,
1414 rescan);
1415 else
1408 scsi_scan_channel(shost, channel, id, lun, rescan); 1416 scsi_scan_channel(shost, channel, id, lun, rescan);
1409 else 1417 }
1410 scsi_scan_channel(shost, channel, id, lun, rescan);
1411 up(&shost->scan_mutex); 1418 up(&shost->scan_mutex);
1412 1419
1413 return 0; 1420 return 0;