[4.2-rc1] gpio: omap: add missed spin_unlock_irqrestore in omap_gpio_irq_type
diff mbox

Message ID 1435157657-17843-1-git-send-email-grygorii.strashko@ti.com
State New
Headers show

Commit Message

Grygorii Strashko June 24, 2015, 2:54 p.m. UTC
From: Grygorii Strashko <grygorii.strashko@linaro.org>

Add missed spin_unlock_irqrestore in omap_gpio_irq_type when
omap_set_gpio_triggering() is failed.

It fixes static checker warning:

	drivers/gpio/gpio-omap.c:523 omap_gpio_irq_type()
	warn: inconsistent returns 'spin_lock:&bank->lock'.

This fixes commit:
1562e4618ded ('gpio: omap: fix error handling in omap_gpio_irq_type')

Reported-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Linus Walleij July 16, 2015, 8:36 a.m. UTC | #1
On Wed, Jun 24, 2015 at 4:54 PM, Grygorii Strashko
<grygorii.strashko@ti.com> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Add missed spin_unlock_irqrestore in omap_gpio_irq_type when
> omap_set_gpio_triggering() is failed.
>
> It fixes static checker warning:
>
>         drivers/gpio/gpio-omap.c:523 omap_gpio_irq_type()
>         warn: inconsistent returns 'spin_lock:&bank->lock'.
>
> This fixes commit:
> 1562e4618ded ('gpio: omap: fix error handling in omap_gpio_irq_type')
>
> Reported-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied for fixes.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index b0c57d5..a0ad803 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -500,8 +500,10 @@  static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 
 	spin_lock_irqsave(&bank->lock, flags);
 	retval = omap_set_gpio_triggering(bank, offset, type);
-	if (retval)
+	if (retval) {
+		spin_unlock_irqrestore(&bank->lock, flags);
 		goto error;
+	}
 	omap_gpio_init_irq(bank, offset);
 	if (!omap_gpio_is_input(bank, offset)) {
 		spin_unlock_irqrestore(&bank->lock, flags);