cmd: fix return code of 'sf erase'
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 2 Jan 2023 17:21:16 +0000 (18:21 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 26 Jan 2023 15:35:13 +0000 (21:05 +0530)
commitee0b0be204aad0cee41167546fa3fc82f2aa57e8
treef9552d4a956fa3dfa7e1c2602afcfc822ef69d23
parent8c8df676095ea05290f3deff1c8449f82e52b6ed
cmd: fix return code of 'sf erase'

If the offset or the size passed to the 'sf erase' 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>
Acked-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
cmd/sf.c