X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fscsi%2Fscsi_scan.c;h=1bd92b9b46d9ccc5209103beb59cfb75ccafdb5d;hb=737c17561fb2c6a72810cca7d7c0b8bdc29bb120;hp=f85d9100f554ee7a232e177074a5c6ccf38a1046;hpb=c5f2e6404c65e8380c9ba80a7d58a27d2642743b;p=powerpc.git diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index f85d9100f5..1bd92b9b46 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -25,7 +25,6 @@ * or a LUN is seen that cannot have a device attached to it. */ -#include #include #include #include @@ -33,11 +32,11 @@ #include #include +#include #include #include #include #include -#include #include #include @@ -810,6 +809,7 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags) static inline void scsi_destroy_sdev(struct scsi_device *sdev) { + scsi_device_set_state(sdev, SDEV_DEL); if (sdev->host->hostt->slave_destroy) sdev->host->hostt->slave_destroy(sdev); transport_destroy_device(&sdev->sdev_gendev); @@ -1503,7 +1503,7 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, __FUNCTION__, channel, id, lun)); if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || - ((id != SCAN_WILD_CARD) && (id > shost->max_id)) || + ((id != SCAN_WILD_CARD) && (id >= shost->max_id)) || ((lun != SCAN_WILD_CARD) && (lun > shost->max_lun))) return -EINVAL;