gpio: omap: irq_startup() must not return error codes
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 10 Jun 2019 17:11:02 +0000 (20:11 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 12 Jun 2019 09:15:04 +0000 (11:15 +0200)
The irq_startup() method returns an unsigned int, but in __irq_startup()
it is assigned to an int.  However, nothing checks for errors, so any
error that is returned is ignored.

Remove the check for GPIO-input mode and the error return.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-omap.c

index 61e32c7e66706e06d343ef8edcacdcd1f7069d22..94b10dfbff3f06a4af4198a3da3ac4486d1b0370 100644 (file)
@@ -635,8 +635,6 @@ static unsigned int omap_gpio_irq_startup(struct irq_data *d)
 
        if (!LINE_USED(bank->mod_usage, offset))
                omap_set_gpio_direction(bank, offset, 1);
-       else if (!omap_gpio_is_input(bank, offset))
-               goto err;
        omap_enable_gpio_module(bank, offset);
        bank->irq_usage |= BIT(offset);
 
@@ -644,9 +642,6 @@ static unsigned int omap_gpio_irq_startup(struct irq_data *d)
        omap_gpio_unmask_irq(d);
 
        return 0;
-err:
-       raw_spin_unlock_irqrestore(&bank->lock, flags);
-       return -EINVAL;
 }
 
 static void omap_gpio_irq_shutdown(struct irq_data *d)