X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_spi.c;h=bafa217d039d6ce5a1d58e42220d20379d47c728;hb=4638b21f2ebc3781def51e82fb4e425a468f2e49;hp=40ee7e7dd3c7daa08270fbfc72d0d7967d92077c;hpb=d255bb0e78d1cac5b7c8c98cb77a095f5f16de0d;p=u-boot diff --git a/common/cmd_spi.c b/common/cmd_spi.c index 40ee7e7dd3..bafa217d03 100644 --- a/common/cmd_spi.c +++ b/common/cmd_spi.c @@ -63,7 +63,7 @@ static uchar din[MAX_SPI_BYTES]; * The command prints out the hexadecimal string received via SPI. */ -int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { struct spi_slave *slave; char *cp = 0; @@ -123,9 +123,8 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) printf("Error with the SPI transaction.\n"); rcode = 1; } else { - cp = (char *)din; for(j = 0; j < ((bitlen + 7) / 8); j++) { - printf("%02X", *cp++); + printf("%02X", din[j]); } printf("\n"); } @@ -139,9 +138,9 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) U_BOOT_CMD( sspi, 5, 1, do_spi, - "sspi - SPI utility commands\n", + "SPI utility commands", " - Send bits from out the SPI\n" " - Identifies the chip select of the device\n" " - Number of bits to send (base 10)\n" - " - Hexadecimal string that gets sent\n" + " - Hexadecimal string that gets sent" );