* [PATCH] pinctrl: fix error check return value of irq_of_parse_and_map()
@ 2022-04-22 8:52 cgel.zte
2022-04-24 3:14 ` [PATCH v2] " cgel.zte
0 siblings, 1 reply; 3+ messages in thread
From: cgel.zte @ 2022-04-22 8:52 UTC (permalink / raw)
To: linus.walleij, govindraj.raja
Cc: Damien.Horsley, abrestic, ezequiel.garcia, linux-gpio,
linux-kernel, Lv Ruyi, Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.
Fixes: cefc03e5995e ("pinctrl: Add Pistachio SoC pin control driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
drivers/pinctrl/pinctrl-pistachio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c
index 8d271c6b0ca4..ff34f9755368 100644
--- a/drivers/pinctrl/pinctrl-pistachio.c
+++ b/drivers/pinctrl/pinctrl-pistachio.c
@@ -1374,7 +1374,7 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
}
irq = irq_of_parse_and_map(child, 0);
- if (irq < 0) {
+ if (!irq) {
dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq);
of_node_put(child);
ret = irq;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2] pinctrl: fix error check return value of irq_of_parse_and_map()
2022-04-22 8:52 [PATCH] pinctrl: fix error check return value of irq_of_parse_and_map() cgel.zte
@ 2022-04-24 3:14 ` cgel.zte
2022-04-24 14:25 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: cgel.zte @ 2022-04-24 3:14 UTC (permalink / raw)
To: cgel.zte
Cc: Damien.Horsley, abrestic, ezequiel.garcia, govindraj.raja,
linus.walleij, linux-gpio, linux-kernel, lv.ruyi, Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.
Fixes: cefc03e5995e ("pinctrl: Add Pistachio SoC pin control driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
v2: don't print irq, and return -EINVAL rather than 0
---
drivers/pinctrl/pinctrl-pistachio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c
index 8d271c6b0ca4..5de691c630b4 100644
--- a/drivers/pinctrl/pinctrl-pistachio.c
+++ b/drivers/pinctrl/pinctrl-pistachio.c
@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
}
irq = irq_of_parse_and_map(child, 0);
- if (irq < 0) {
- dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq);
+ if (!irq) {
+ dev_err(pctl->dev, "No IRQ for bank %u\n", i);
of_node_put(child);
- ret = irq;
+ ret = -EINVAL;
goto err;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] pinctrl: fix error check return value of irq_of_parse_and_map()
2022-04-24 3:14 ` [PATCH v2] " cgel.zte
@ 2022-04-24 14:25 ` Linus Walleij
0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2022-04-24 14:25 UTC (permalink / raw)
To: cgel.zte
Cc: Damien.Horsley, abrestic, ezequiel.garcia, govindraj.raja,
linux-gpio, linux-kernel, lv.ruyi, Zeal Robot
On Sun, Apr 24, 2022 at 5:14 AM <cgel.zte@gmail.com> wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> The irq_of_parse_and_map() function returns 0 on failure, and does not
> return an negative value.
>
> Fixes: cefc03e5995e ("pinctrl: Add Pistachio SoC pin control driver")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
> v2: don't print irq, and return -EINVAL rather than 0
Patch applied for fixes (changed the subject a bit).
Thanks!
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-24 14:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22 8:52 [PATCH] pinctrl: fix error check return value of irq_of_parse_and_map() cgel.zte
2022-04-24 3:14 ` [PATCH v2] " cgel.zte
2022-04-24 14:25 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.