mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
cmd: clk: Check return value from soc_clk_dump
In case of error in soc_clk_dump function are returned different values then CMD return values (-1, 0, 1). For example: ZynqMP> clk dump exit not allowed from main input shel The patch is checking all negative return values and return CMD_RET_FAILURE which is proper reaction for these cases. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
811c7bdebe
commit
ebc675b98d
1 changed files with 9 additions and 1 deletions
10
cmd/clk.c
10
cmd/clk.c
|
@ -16,7 +16,15 @@ int __weak soc_clk_dump(void)
|
|||
static int do_clk_dump(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
return soc_clk_dump();
|
||||
int ret;
|
||||
|
||||
ret = soc_clk_dump();
|
||||
if (ret < 0) {
|
||||
printf("Clock dump error %d\n", ret);
|
||||
ret = CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static cmd_tbl_t cmd_clk_sub[] = {
|
||||
|
|
Loading…
Add table
Reference in a new issue