drivers: flash: report if the read returns an error
This matches the other commands that log on error. Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
parent
31d615eab5
commit
d0f87fa9d8
1 changed files with 5 additions and 1 deletions
|
@ -156,7 +156,11 @@ static int cmd_read(const struct shell *shell, size_t argc, char *argv[])
|
|||
while (cnt--) {
|
||||
uint32_t data;
|
||||
|
||||
flash_read(flash_dev, addr, &data, sizeof(data));
|
||||
ret = flash_read(flash_dev, addr, &data, sizeof(data));
|
||||
if (ret != 0) {
|
||||
shell_error(shell, "Read ERROR!");
|
||||
return -EIO;
|
||||
}
|
||||
shell_print(shell, "0x%08x ", data);
|
||||
addr += sizeof(data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue