diff options
author | Simon Glass | 2017-06-14 21:28:41 -0600 |
---|---|---|
committer | Simon Glass | 2017-07-11 10:08:19 -0600 |
commit | 8eab1a58dd53cbf89dca54f91cf3fbb51d714644 (patch) | |
tree | 2ec0bcfab13a2374da951e8b7339d264fd19985b /drivers | |
parent | 4682c8a19b4eb69f7ad51df3f543375583ce878a (diff) |
dm: scsi: Document and rename the scsi_scan() parameter
The 'mode' parameter is actually a flag to determine whether to display
a list of devices found during the scan. Rename it to reflect this, add a
function comment and adjust callers to use a boolean.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/scsi.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 9232f3a8243..f3f8d31e1a4 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -326,7 +326,7 @@ void scsi_init(void) #endif bootstage_start(BOOTSTAGE_ID_ACCUM_SCSI, "ahci"); scsi_low_level_init(busdevfunc); - scsi_scan(1); + scsi_scan(true); bootstage_accum(BOOTSTAGE_ID_ACCUM_SCSI); } #endif @@ -555,7 +555,7 @@ removable: * to the user if mode = 1 */ #if defined(CONFIG_DM_SCSI) -static int do_scsi_scan_one(struct udevice *dev, int id, int lun, int mode) +static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose) { int ret; struct udevice *bdev; @@ -594,21 +594,21 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, int mode) memcpy(&bdesc->revision, &bd.revision, sizeof(bd.revision)); part_init(bdesc); - if (mode == 1) { + if (verbose) { printf(" Device %d: ", 0); dev_print(bdesc); } return 0; } -int scsi_scan(int mode) +int scsi_scan(bool verbose) { unsigned char i, lun; struct uclass *uc; struct udevice *dev; /* SCSI controller */ int ret; - if (mode == 1) + if (verbose) printf("scanning bus for devices...\n"); blk_unbind_all(IF_TYPE_SCSI); @@ -630,18 +630,18 @@ int scsi_scan(int mode) for (i = 0; i < plat->max_id; i++) for (lun = 0; lun < plat->max_lun; lun++) - do_scsi_scan_one(dev, i, lun, mode); + do_scsi_scan_one(dev, i, lun, verbose); } return 0; } #else -int scsi_scan(int mode) +int scsi_scan(bool verbose) { unsigned char i, lun; int ret; - if (mode == 1) + if (verbose) printf("scanning bus for devices...\n"); for (i = 0; i < CONFIG_SYS_SCSI_MAX_DEVICE; i++) scsi_init_dev_desc(&scsi_dev_desc[i], i); @@ -655,10 +655,10 @@ int scsi_scan(int mode) continue; part_init(&scsi_dev_desc[scsi_max_devs]); - if (mode == 1) { + if (verbose) { printf(" Device %d: ", 0); dev_print(&scsi_dev_desc[scsi_max_devs]); - } /* if mode */ + } scsi_max_devs++; } /* next LUN */ } |