X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fcmd_sf.c;h=d571f60c04874bdfea4589d99a9bd1410d3f1b89;hb=9179dd3bf5c257d1479fb4a154b57f33e3d839be;hp=8c0a7514dfa210436f066ba81300ba6a409f071d;hpb=1859e42fbf996e0e883cdb9829ef6d260bf4cdd6;p=oweals%2Fu-boot.git diff --git a/common/cmd_sf.c b/common/cmd_sf.c index 8c0a7514df..d571f60c04 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -48,7 +48,7 @@ static int do_spi_flash_probe(int argc, char *argv[]) goto usage; } if (argc >= 4) { - mode = simple_strtoul(argv[3], &endp, 0); + mode = simple_strtoul(argv[3], &endp, 16); if (*argv[3] == 0 || *endp != 0) goto usage; } @@ -175,17 +175,18 @@ static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return do_spi_flash_erase(argc - 1, argv + 1); usage: - printf("Usage:\n%s\n", cmdtp->usage); + cmd_usage(cmdtp); return 1; } U_BOOT_CMD( sf, 5, 1, do_spi_flash, - "sf - SPI flash sub-system\n", + "SPI flash sub-system", "probe [bus:]cs [hz] [mode] - init flash device on given SPI bus\n" " and chip select\n" "sf read addr offset len - read `len' bytes starting at\n" " `offset' to memory at `addr'\n" "sf write addr offset len - write `len' bytes from memory\n" " at `addr' to flash at `offset'\n" - "sf erase offset len - erase `len' bytes from `offset'\n"); + "sf erase offset len - erase `len' bytes from `offset'" +);