diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gpio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/gpio.c b/cmd/gpio.c index 16c2cebb3d..408a942455 100644 --- a/cmd/gpio.c +++ b/cmd/gpio.c @@ -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) |