diff mbox series

[v2,2/2] pinctrl: nuvoton: Fix irq_of_parse_and_map() return value

Message ID 20220423094142.33013-2-krzysztof.kozlowski@linaro.org
State New
Headers show
Series [v2,1/2] pinctrl: mvebu: Fix irq_of_parse_and_map() return value | expand

Commit Message

Krzysztof Kozlowski April 23, 2022, 9:41 a.m. UTC
The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.

Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. Correct the return value passed further.
---
 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Linus Walleij April 28, 2022, 10:52 p.m. UTC | #1
On Sat, Apr 23, 2022 at 11:41 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:

> The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
>
> Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Changes since v1:
> 1. Correct the return value passed further.

This doesn't apply to my tree neither for fixes or devel, can you rebase it?
I'd like to queue it on devel for non-urgent fixes.

Yours,
Linus Walleij
Krzysztof Kozlowski April 29, 2022, 6:03 a.m. UTC | #2
On 29/04/2022 00:52, Linus Walleij wrote:
> On Sat, Apr 23, 2022 at 11:41 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
> 
>> The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
>>
>> Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Changes since v1:
>> 1. Correct the return value passed further.
> 
> This doesn't apply to my tree neither for fixes or devel, can you rebase it?
> I'd like to queue it on devel for non-urgent fixes.

Sure, I will rebase. The issue was because of Andy's commit
https://lore.kernel.org/all/20220401103604.8705-9-andriy.shevchenko@linux.intel.com/
which was in next but not in your tree.

Including such development branches in next, bypassing maintainer, makes
it difficult for everyone else to develop patches... :(


Best regards,
Krzysztof
Andy Shevchenko April 29, 2022, 12:52 p.m. UTC | #3
On Fri, Apr 29, 2022 at 08:03:19AM +0200, Krzysztof Kozlowski wrote:
> On 29/04/2022 00:52, Linus Walleij wrote:
> > On Sat, Apr 23, 2022 at 11:41 AM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> > 
> >> The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
> >>
> >> Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> Changes since v1:
> >> 1. Correct the return value passed further.
> > 
> > This doesn't apply to my tree neither for fixes or devel, can you rebase it?
> > I'd like to queue it on devel for non-urgent fixes.
> 
> Sure, I will rebase. The issue was because of Andy's commit
> https://lore.kernel.org/all/20220401103604.8705-9-andriy.shevchenko@linux.intel.com/
> which was in next but not in your tree.
> 
> Including such development branches in next, bypassing maintainer, makes
> it difficult for everyone else to develop patches... :(

I'm about to send PR with my stuff to Linus and Bart, but I have difficulties
right now with the signing tag. I hope I figure out sooner than later.
diff mbox series

Patch

diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
index 3cf0f8a43c37..cc085ba2d7e4 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
@@ -1898,9 +1898,9 @@  static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl)
 		}
 
 		ret = irq_of_parse_and_map(np, 0);
-		if (ret < 0) {
+		if (!ret) {
 			dev_err(dev, "No IRQ for GPIO bank %u\n", id);
-			return ret;
+			return -EINVAL;
 		}
 		pctrl->gpio_bank[id].irq = ret;
 		pctrl->gpio_bank[id].irq_chip = npcmgpio_irqchip;