]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: Fix an error code in cmd_mux_find()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 25 Jul 2023 06:50:08 +0000 (09:50 +0300)
committerTom Rini <trini@konsulko.com>
Tue, 8 Aug 2023 21:05:43 +0000 (17:05 -0400)
This returns the wrong variable.  It ends up returning NULL when it was
suppose to return an error pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
cmd/mux.c

index 833266f08b1e48a1a5b84e761ca69f833faf0d7f..c75907af7726808a48ff2c8cea5f0641a4d0ff36 100644 (file)
--- a/cmd/mux.c
+++ b/cmd/mux.c
@@ -49,7 +49,7 @@ static struct mux_control *cmd_mux_find(char *const argv[])
 
        chip = dev_get_uclass_priv(dev);
        if (!chip)
-               return ERR_PTR(ret);
+               return ERR_PTR(-EINVAL);
 
        if (id >= chip->controllers)
                return ERR_PTR(-EINVAL);