]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: gpio: remove dead code
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 30 Jan 2018 23:45:51 +0000 (00:45 +0100)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tue, 13 Feb 2018 11:52:47 +0000 (12:52 +0100)
In the following statements
if (a) return a; if (a) return c;
the second return can never be executed.

Identified by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
drivers/gpio/rk_gpio.c

index 11fc3e26bd761a04cf998876df48bfb475bcbac7..2419636c5f5d9fccb0a9daa856587cbb3901cd42 100644 (file)
@@ -86,10 +86,6 @@ static int rockchip_gpio_get_function(struct udevice *dev, unsigned offset)
        ret = pinctrl_get_gpio_mux(priv->pinctrl, priv->bank, offset);
        if (ret)
                return ret;
-
-       /* If it's not 0, then it is not a GPIO */
-       if (ret)
-               return GPIOF_FUNC;
        is_output = readl(&regs->swport_ddr) & OFFSET_TO_BIT(offset);
 
        return is_output ? GPIOF_OUTPUT : GPIOF_INPUT;