[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUXxjL=zb8Kq1PFsOFYxsCxx-g2ZOCit+YGDOTM-JKpZw@mail.gmail.com>
Date: Mon, 20 Dec 2021 11:20:33 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc: Rob Herring <robh+dt@...nel.org>,
Nicolas Saenz Julienne <nsaenz@...nel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@...adcom.com>,
Chris Brandt <chris.brandt@...esas.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Linux I2C <linux-i2c@...r.kernel.org>,
linux-rpi-kernel <linux-rpi-kernel@...ts.infradead.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
Prabhakar <prabhakar.csengg@...il.com>
Subject: Re: [PATCH 3/3] i2c: riic: Use platform_get_irq() to get the interrupt
Hi Prabhakar,
On Sat, Dec 18, 2021 at 5:59 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@...renesas.com> wrote:
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
>
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq().
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> --- a/drivers/i2c/busses/i2c-riic.c
> +++ b/drivers/i2c/busses/i2c-riic.c
> @@ -433,12 +433,12 @@ static int riic_i2c_probe(struct platform_device *pdev)
> }
>
> for (i = 0; i < ARRAY_SIZE(riic_irqs); i++) {
> - res = platform_get_resource(pdev, IORESOURCE_IRQ, riic_irqs[i].res_num);
> - if (!res)
> - return -ENODEV;
> + ret = platform_get_irq(pdev, riic_irqs[i].res_num);
> + if (ret <= 0)
This can be "ret < 0".
> + return ret ? ret : -ENXIO;
>
> - ret = devm_request_irq(&pdev->dev, res->start, riic_irqs[i].isr,
> - 0, riic_irqs[i].name, riic);
> + ret = devm_request_irq(&pdev->dev, ret, riic_irqs[i].isr,
> + 0, riic_irqs[i].name, riic);
> if (ret) {
> dev_err(&pdev->dev, "failed to request irq %s\n", riic_irqs[i].name);
> return ret;
With the above fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists