diff mbox series

[1/2] irqchip/aspeed-i2c-ic: Fix irq_of_parse_and_map() return value

Message ID 20220422104536.61451-1-krzysztof.kozlowski@linaro.org
State Superseded
Headers show
Series [1/2] irqchip/aspeed-i2c-ic: Fix irq_of_parse_and_map() return value | expand

Commit Message

Krzysztof Kozlowski April 22, 2022, 10:45 a.m. UTC
The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.

Fixes: f48e699ddf70 ("irqchip/aspeed-i2c-ic: Add I2C IRQ controller for Aspeed")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/irqchip/irq-aspeed-i2c-ic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Kozlowski April 23, 2022, 9:30 a.m. UTC | #1
On 22/04/2022 12:45, Krzysztof Kozlowski wrote:
> The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
> 
> Fixes: f48e699ddf70 ("irqchip/aspeed-i2c-ic: Add I2C IRQ controller for Aspeed")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/irqchip/irq-aspeed-i2c-ic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
> index a47db16ff960..cef1291ae783 100644
> --- a/drivers/irqchip/irq-aspeed-i2c-ic.c
> +++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
> @@ -77,7 +77,7 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node,
>  	}
>  
>  	i2c_ic->parent_irq = irq_of_parse_and_map(node, 0);
> -	if (i2c_ic->parent_irq < 0) {
> +	if (!i2c_ic->parent_irq) {
>  		ret = i2c_ic->parent_irq;

This is wrong (same in patch 2). I will send a v2.


Best regards,
Krzysztof
Marc Zyngier April 23, 2022, 9:43 a.m. UTC | #2
On Sat, 23 Apr 2022 10:30:53 +0100,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
> On 22/04/2022 12:45, Krzysztof Kozlowski wrote:
> > The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
> > 
> > Fixes: f48e699ddf70 ("irqchip/aspeed-i2c-ic: Add I2C IRQ controller for Aspeed")
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  drivers/irqchip/irq-aspeed-i2c-ic.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
> > index a47db16ff960..cef1291ae783 100644
> > --- a/drivers/irqchip/irq-aspeed-i2c-ic.c
> > +++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
> > @@ -77,7 +77,7 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node,
> >  	}
> >  
> >  	i2c_ic->parent_irq = irq_of_parse_and_map(node, 0);
> > -	if (i2c_ic->parent_irq < 0) {
> > +	if (!i2c_ic->parent_irq) {
> >  		ret = i2c_ic->parent_irq;
> 
> This is wrong (same in patch 2). I will send a v2.

While you're at it, please add a cover letter when sending a series
containing more than a single patch.

Thanks,

	M.
diff mbox series

Patch

diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
index a47db16ff960..cef1291ae783 100644
--- a/drivers/irqchip/irq-aspeed-i2c-ic.c
+++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
@@ -77,7 +77,7 @@  static int __init aspeed_i2c_ic_of_init(struct device_node *node,
 	}
 
 	i2c_ic->parent_irq = irq_of_parse_and_map(node, 0);
-	if (i2c_ic->parent_irq < 0) {
+	if (!i2c_ic->parent_irq) {
 		ret = i2c_ic->parent_irq;
 		goto err_iounmap;
 	}