[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+V-a8vdsLaL4bwsv1ORKDK1YXUhQHzAwUrUHUiaG9SJCSOV+Q@mail.gmail.com>
Date: Fri, 17 Dec 2021 14:14:33 +0000
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: Sergey Shtylyov <s.shtylyov@....ru>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
linux-ide@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to
populate IRQ resource
Hi Sergey,
On Fri, Dec 17, 2021 at 9:33 AM Sergey Shtylyov <s.shtylyov@....ru> wrote:
>
> Hello!
>
> On 17.12.2021 3:12, Lad Prabhakar 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 bypassed the hierarchical setup and messed up the
> > irq chaining.
> >
> > In preparation for removal of static setup of IRQ resource from DT core
> > code use of_irq_to_resource().
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> > ---
> > Hi,
> >
> > Dropping usage of platform_get_resource() was agreed based on
> > the discussion [0].
> >
> > [0] https://patchwork.kernel.org/project/linux-renesas-soc/
> > patch/20211209001056.29774-1-prabhakar.mahadev-lad.rj@...renesas.com/
> >
> > Cheers,
> > Prabhakar
> > ---
> > drivers/ata/pata_of_platform.c | 11 ++++++++---
> > 1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
> > index 35aa158fc976..557f349eb533 100644
> > --- a/drivers/ata/pata_of_platform.c
> > +++ b/drivers/ata/pata_of_platform.c
> [...]
> > @@ -45,7 +47,9 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
> > return -EINVAL;
> > }
> >
> > - irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
> > + irq = of_irq_to_resource(dn, 0, &irq_res);
>
> Why not use platform_get_irq_optional()?
>
Agreed.
Cheers,
Prabhakar
> > + if (irq <= 0 && irq != -ENXIO)
> > + return irq ? irq : -ENXIO;
> >
> > of_property_read_u32(dn, "reg-shift", ®_shift);
> >
> [...]
>
> MBR, Sergey
Powered by blists - more mailing lists