cmd: efidebug: fix -Werror=type-limits warning
[oweals/u-boot.git] / cmd / gpio.c
index 16c2cebb3d4bf6a125e452de7b852f718d681acf..408a942455b58627a81107f3145fe08e33fbeb9f 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)