diff options
author | Michal Simek <michal.simek@xilinx.com> | 2016-11-30 12:12:31 +0100 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2016-12-02 14:37:26 +0100 |
commit | c002e39ae669403baf21a7e04473447387f6302d (patch) | |
tree | a8cfcc57ca70b5651ee234c6da240685ee432942 /cmd | |
parent | 545a284711eb767ccb67ee6746b64bb330fa9303 (diff) | |
download | u-boot-imx-c002e39ae669403baf21a7e04473447387f6302d.zip u-boot-imx-c002e39ae669403baf21a7e04473447387f6302d.tar.gz u-boot-imx-c002e39ae669403baf21a7e04473447387f6302d.tar.bz2 |
scsi: Change scsi_scan() to be able to return value
With DM_SCSI this function will return more than one return value to
cover errors.
Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/scsi.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -27,6 +27,8 @@ int do_scsiboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) */ int do_scsi(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { + int ret; + switch (argc) { case 0: case 1: @@ -35,8 +37,10 @@ int do_scsi(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (strncmp(argv[1], "res", 3) == 0) { printf("\nReset SCSI\n"); scsi_bus_reset(); - scsi_scan(1); - return 0; + ret = scsi_scan(1); + if (ret) + return CMD_RET_FAILURE; + return ret; } if (strncmp(argv[1], "inf", 3) == 0) { blk_list_devices(IF_TYPE_SCSI); @@ -51,8 +55,10 @@ int do_scsi(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) return 0; } if (strncmp(argv[1], "scan", 4) == 0) { - scsi_scan(1); - return 0; + ret = scsi_scan(1); + if (ret) + return CMD_RET_FAILURE; + return ret; } if (strncmp(argv[1], "part", 4) == 0) { if (blk_list_part(IF_TYPE_SCSI)) |