]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_gpio.c
karo: tx53: romupdate: fix calculation of starting block in tx53_prog_uboot()
[karo-tx-uboot.git] / common / cmd_gpio.c
index c0cdc5f6fdfd7669d0151c07367f0e974a05f26b..58d8125f84dac75a7ea0db3099c04d838ea9064d 100644 (file)
@@ -12,7 +12,7 @@
 #include <dm.h>
 #include <asm/gpio.h>
 
-int __weak name_to_gpio(const char *name)
+__weak int name_to_gpio(const char *name)
 {
        return simple_strtoul(name, NULL, 10);
 }
@@ -186,7 +186,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        ret = gpio_request(gpio, "cmd_gpio");
        if (ret && ret != -EBUSY) {
                printf("gpio: requesting pin %u failed\n", gpio);
-               return -1;
+               return CMD_RET_FAILURE;
        }
 
        /* finally, let's do it: set direction and exec command */
@@ -208,7 +208,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (ret != -EBUSY)
                gpio_free(gpio);
 
-       return value;
+       return (ret && ret != -EBUSY) ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
 }
 
 U_BOOT_CMD(gpio, 4, 0, do_gpio,