Blackfin: otp: fix build after constification of args[]
The OTP code does a little shuffling of arguments that aren't really necessary, so use a local variable instead to fix build errors now that the args[] parameter is const. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
4c95ff6419
commit
fcbd5b73d7
|
@ -82,6 +82,7 @@ static void set_otp_timing(bool write)
|
||||||
|
|
||||||
int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
|
char *cmd;
|
||||||
uint32_t ret, base_flags;
|
uint32_t ret, base_flags;
|
||||||
bool prompt_user, force_read;
|
bool prompt_user, force_read;
|
||||||
uint32_t (*otp_func)(uint32_t page, uint32_t flags, uint64_t *page_content);
|
uint32_t (*otp_func)(uint32_t page, uint32_t flags, uint64_t *page_content);
|
||||||
|
@ -93,21 +94,21 @@ int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
|
||||||
prompt_user = false;
|
prompt_user = false;
|
||||||
base_flags = 0;
|
base_flags = 0;
|
||||||
if (!strcmp(argv[1], "read"))
|
cmd = argv[1];
|
||||||
|
if (!strcmp(cmd, "read"))
|
||||||
otp_func = bfrom_OtpRead;
|
otp_func = bfrom_OtpRead;
|
||||||
else if (!strcmp(argv[1], "dump")) {
|
else if (!strcmp(cmd, "dump")) {
|
||||||
otp_func = bfrom_OtpRead;
|
otp_func = bfrom_OtpRead;
|
||||||
force_read = true;
|
force_read = true;
|
||||||
} else if (!strcmp(argv[1], "write")) {
|
} else if (!strcmp(cmd, "write")) {
|
||||||
otp_func = bfrom_OtpWrite;
|
otp_func = bfrom_OtpWrite;
|
||||||
base_flags = OTP_CHECK_FOR_PREV_WRITE;
|
base_flags = OTP_CHECK_FOR_PREV_WRITE;
|
||||||
if (!strcmp(argv[2], "--force")) {
|
if (!strcmp(argv[2], "--force")) {
|
||||||
argv[2] = argv[1];
|
|
||||||
argv++;
|
argv++;
|
||||||
--argc;
|
--argc;
|
||||||
} else
|
} else
|
||||||
prompt_user = false;
|
prompt_user = false;
|
||||||
} else if (!strcmp(argv[1], "lock")) {
|
} else if (!strcmp(cmd, "lock")) {
|
||||||
if (argc != 4)
|
if (argc != 4)
|
||||||
goto usage;
|
goto usage;
|
||||||
otp_func = bfrom_OtpWrite;
|
otp_func = bfrom_OtpWrite;
|
||||||
|
@ -175,7 +176,7 @@ int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("OTP memory %s: addr 0x%p page 0x%03X count %zu ... ",
|
printf("OTP memory %s: addr 0x%p page 0x%03X count %zu ... ",
|
||||||
argv[1], addr, page, count);
|
cmd, addr, page, count);
|
||||||
|
|
||||||
set_otp_timing(otp_func == bfrom_OtpWrite);
|
set_otp_timing(otp_func == bfrom_OtpWrite);
|
||||||
if (otp_func == bfrom_OtpWrite && check_voltage()) {
|
if (otp_func == bfrom_OtpWrite && check_voltage()) {
|
||||||
|
|
Loading…
Reference in New Issue