cmd: Fix an error code in cmd_mux_find()

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>
This commit is contained in:
Dan Carpenter 2023-07-25 09:50:08 +03:00 committed by Tom Rini
parent 7c00b80d48
commit 1ded89e78b

View file

@ -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);