mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
cmd: gpio: Make gpio input
return pin value again
4dbc107f46
("cmd: gpio: Correct do_gpio() return value") correctly changed the behaviour of the gpio command to return CMD_RET_SUCCESS or CMD_RET_FAILURE, but any existing script which expects the return value to be the pin value is broken by this change. Reinstate the legacy behaviour for `gpio input` only. Fixes:4dbc107f46
("cmd: gpio: Correct do_gpio() return value") Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Alex Kiernan <alex.kiernan@hivehome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
dde1b75e95
commit
4af2a33ee5
2 changed files with 43 additions and 1 deletions
|
@ -248,7 +248,12 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
if (ret != -EBUSY)
|
||||
gpio_free(gpio);
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
/*
|
||||
* Whilst wrong, the legacy gpio input command returns the pin
|
||||
* value, or CMD_RET_FAILURE (which is indistinguishable from a
|
||||
* valid pin value).
|
||||
*/
|
||||
return (sub_cmd == GPIOC_INPUT) ? value : CMD_RET_SUCCESS;
|
||||
|
||||
err:
|
||||
if (ret != -EBUSY)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue