diff mbox

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

Message ID 1435157657-17843-1-git-send-email-grygorii.strashko@ti.com
State Accepted
Commit 977bd8a94c40851a843e9186b9eb823bdfa5ace2
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-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Linus Walleij Aug. 13, 2015, 12:44 p.m. UTC | #2
On Fri, Aug 7, 2015 at 9:34 AM, Grygorii Strashko
<grygorii.strashko@ti.com> wrote:
> Hi Tony,
> On 08/07/2015 06:36 AM, Tony Lindgren wrote:
>>
>> * Linus Walleij <linus.walleij@linaro.org> [150716 01:38]:
>>>
>>> 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.
>>
>>
>> Linus, looks like we now have a new build warning in Linux next
>> with the fixes and raw_spinlock_t change, so a merge or a commit
>> is needed. If you prefer a patch, here's one below.
>
>
> Yes. It seems merge/rebase issue between fixes & next:
> - this patch went through fixes and RAW spinlock conversation
> patch through -next, and without merge conflicts.
>
> and patch has been posted already by Axel Lin:
> http://www.spinics.net/lists/linux-omap/msg121031.html

I merged v4.2-rc4 into my devel branch and applied Axel's
patch to fix this mess. Check that it looks OK now...

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

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