soc/fsl/qe: Fix an error code in qe_pin_request()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 28 Mar 2019 14:18:41 +0000 (17:18 +0300)
committerLi Yang <leoyang.li@nxp.com>
Tue, 2 Apr 2019 23:02:48 +0000 (18:02 -0500)
We forgot to set "err" on this error path.

Fixes: 1a2d397a6eb5 ("gpio/powerpc: Eliminate duplication of of_get_named_gpio_flags()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/soc/fsl/qe/gpio.c

index 819bed0f566799db5e34988282ae85032a8742ad..51b3a47b5a559b4d3b6663a87f417a793181033b 100644 (file)
@@ -179,8 +179,10 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index)
        if (err < 0)
                goto err0;
        gc = gpio_to_chip(err);
-       if (WARN_ON(!gc))
+       if (WARN_ON(!gc)) {
+               err = -ENODEV;
                goto err0;
+       }
 
        if (!of_device_is_compatible(gc->of_node, "fsl,mpc8323-qe-pario-bank")) {
                pr_debug("%s: tried to get a non-qe pin\n", __func__);