]> git.baikalelectronics.ru Git - uboot.git/commit
cmd: fix return code of 'sf write' and 'sf read'
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 2 Jan 2023 17:21:14 +0000 (18:21 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 26 Jan 2023 15:34:16 +0000 (21:04 +0530)
commit80633b4caa8cb1912b5e71db2a83b7408c321da5
tree0d3c080e1493ed70ada7d7417fb87d3636a66b81
parent8c22dbd107d8a612cadc2006528296030536f53d
cmd: fix return code of 'sf write' and 'sf read'

If the offset or the size passed to the 'sf write' or 'sf read' command
exceeds the size of the SPI flash displaying the command usage is not
helpful. Return CMD_RET_FAILURE instead of CMD_RET_USAGE.

Use the CMD_RET_* constants instead of 0, 1, -1.

Simplify a logical expression in the final return statement.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
cmd/sf.c