Merge tag 'u-boot-rockchip-20200501' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / cmd / gpio.c
index 16c2ceb..408a942 100644 (file)
@@ -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)