Skip to content
Snippets Groups Projects
Commit ebc675b9 authored by Michal Simek's avatar Michal Simek
Browse files

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: default avatarMichal Simek <michal.simek@xilinx.com>
parent 811c7bde
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,15 @@ int __weak soc_clk_dump(void) ...@@ -16,7 +16,15 @@ int __weak soc_clk_dump(void)
static int do_clk_dump(cmd_tbl_t *cmdtp, int flag, int argc, static int do_clk_dump(cmd_tbl_t *cmdtp, int flag, int argc,
char *const argv[]) 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[] = { static cmd_tbl_t cmd_clk_sub[] = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment