From: Seung-Woo Kim Date: Fri, 21 Oct 2016 02:28:42 +0000 (+0900) Subject: cmd: usbdown: fix return value for cmd funtions X-Git-Tag: submit/tizen/20170414.042831~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb7c6ac1d60f8c88b9e7a09dc41a74f9700b6d1e;p=platform%2Fkernel%2Fu-boot.git cmd: usbdown: fix return value for cmd funtions The return value for cmd functions should not be errno, so this patch fixes to use proper return value for cmd functions. Change-Id: I9584ed2e12b81d7807e4fc0b41dbf714462acd1c Signed-off-by: Seung-Woo Kim --- diff --git a/cmd/usbdown.c b/cmd/usbdown.c index c0085cadc1..81350ed5ff 100644 --- a/cmd/usbdown.c +++ b/cmd/usbdown.c @@ -320,12 +320,12 @@ int do_update(cmd_tbl_t *cmdtp, int flags, int argc, char * const argv[]) mmc = find_mmc_device(0); if (!mmc) { error("Device MMC %d - not found!", 0); - return -ENODEV; + return CMD_RET_FAILURE; } if (mmc_init(mmc)) { error("Couldn't init MMC device.\n"); - return -ENODEV; + return CMD_RET_FAILURE; } /* Used the mmc 0 by default */ @@ -337,38 +337,38 @@ int do_update(cmd_tbl_t *cmdtp, int flags, int argc, char * const argv[]) stor_dev = blk_get_devnum_by_type(IF_TYPE_USB, dev); if (stor_dev == NULL) { printf("unknown device\n"); - return -ENODEV; + return CMD_RET_FAILURE; } printf("\n Device %d: ", dev); dev_print(stor_dev); if (stor_dev->type == DEV_TYPE_UNKNOWN) - return 1; + return CMD_RET_FAILURE; usb_stor_curr_dev = dev; printf("... is now current device\n"); } if (fs_set_blk_dev(from, argv[1], FS_TYPE_ANY)) { printf("%d: Unknown block device..\n", __LINE__); - return -ENODEV; + return CMD_RET_FAILURE; } alt_num = usbdown_get_alt(filename); if (alt_num < 0) { printf("There is no %s information\n", filename); - return -EINVAL; + return CMD_RET_FAILURE; } ret = fs_size(filename, &size); if (ret < 0) { printf("There is no %s\n", filename); - return -EINVAL; + return CMD_RET_FAILURE; } usbdown = usbdown_get_entity(alt_num); if (!usbdown) { printf("there is no information for %d\n", alt_num); - return -EINVAL; + return CMD_RET_FAILURE; } #ifdef CONFIG_SIG @@ -423,7 +423,7 @@ int do_update(cmd_tbl_t *cmdtp, int flags, int argc, char * const argv[]) usbdown->dev_num, usbdown->hw_partition); if (ret) - return ret; + return CMD_RET_FAILURE; } while (size > 0) { @@ -449,7 +449,7 @@ int do_update(cmd_tbl_t *cmdtp, int flags, int argc, char * const argv[]) blk_select_hwpart_devnum(IF_TYPE_MMC, usbdown->dev_num, part_num_bkp); - return -EIO; + return CMD_RET_FAILURE; } mmc->block_dev.block_write(&mmc->block_dev, @@ -466,10 +466,10 @@ int do_update(cmd_tbl_t *cmdtp, int flags, int argc, char * const argv[]) ret = blk_select_hwpart_devnum(IF_TYPE_MMC, usbdown->dev_num, part_num_bkp); if (ret) - return ret; + return CMD_RET_FAILURE; } - return 0; + return CMD_RET_SUCCESS; } return CMD_RET_USAGE; @@ -539,7 +539,7 @@ static int do_usb_down(cmd_tbl_t *cmdtp, int flags, int argc, char * const argv[ printf("\n"); } - return 0; + return CMD_RET_SUCCESS; } return CMD_RET_USAGE;