
From: Simon Glass <sjg@chromium.org> The maximum values of target and LUN should be used, rather than one less than those values. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org> --- drivers/scsi/scsi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index f05ef21cfd0..58ac40fb3dd 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -529,6 +529,7 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose) return log_msg_ret("bd", ret); if (verbose) { + log_debug("id %x lun %x:\n", id, lun); printf(" Device %d: ", bdesc->devnum); dev_print(bdesc); } @@ -550,8 +551,8 @@ int scsi_scan_dev(struct udevice *dev, bool verbose) /* Get controller plat */ uc_plat = dev_get_uclass_plat(dev); - for (i = 0; i < uc_plat->max_id; i++) - for (lun = 0; lun < uc_plat->max_lun; lun++) + for (i = 0; i <= uc_plat->max_id; i++) + for (lun = 0; lun <= uc_plat->max_lun; lun++) do_scsi_scan_one(dev, i, lun, verbose); return 0; -- 2.43.0