linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource
@ 2021-12-17  0:12 Lad Prabhakar
  2021-12-17  0:23 ` Damien Le Moal
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lad Prabhakar @ 2021-12-17  0:12 UTC (permalink / raw)
  To: Damien Le Moal, linux-ide
  Cc: Rob Herring, linux-kernel, Prabhakar, Lad Prabhakar

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@bp.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@bp.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
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/platform_device.h>
 #include <linux/ata_platform.h>
 #include <linux/libata.h>
@@ -25,11 +26,12 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
 	struct device_node *dn = ofdev->dev.of_node;
 	struct resource io_res;
 	struct resource ctl_res;
-	struct resource *irq_res;
+	struct resource irq_res;
 	unsigned int reg_shift = 0;
 	int pio_mode = 0;
 	int pio_mask;
 	bool use16bit;
+	int irq;
 
 	ret = of_address_to_resource(dn, 0, &io_res);
 	if (ret) {
@@ -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);
+	if (irq <= 0 && irq != -ENXIO)
+		return irq ? irq : -ENXIO;
 
 	of_property_read_u32(dn, "reg-shift", &reg_shift);
 
@@ -63,7 +67,8 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
 	pio_mask = 1 << pio_mode;
 	pio_mask |= (1 << pio_mode) - 1;
 
-	return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq_res,
+	return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res,
+				     irq > 0 ? &irq_res : NULL,
 				     reg_shift, pio_mask, &pata_platform_sht,
 				     use16bit);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource
  2021-12-17  0:12 [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource Lad Prabhakar
@ 2021-12-17  0:23 ` Damien Le Moal
  2021-12-17  1:16   ` Lad, Prabhakar
  2021-12-17  0:39 ` Rob Herring
  2021-12-17  9:32 ` Sergey Shtylyov
  2 siblings, 1 reply; 7+ messages in thread
From: Damien Le Moal @ 2021-12-17  0:23 UTC (permalink / raw)
  To: Lad Prabhakar, linux-ide; +Cc: Rob Herring, linux-kernel, Prabhakar

On 12/17/21 09: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

s/bypassed/bypasses
s/messed/messes

> 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@bp.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@bp.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
> @@ -9,6 +9,7 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/of_address.h>
> +#include <linux/of_irq.h>
>  #include <linux/platform_device.h>
>  #include <linux/ata_platform.h>
>  #include <linux/libata.h>
> @@ -25,11 +26,12 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
>  	struct device_node *dn = ofdev->dev.of_node;
>  	struct resource io_res;
>  	struct resource ctl_res;
> -	struct resource *irq_res;
> +	struct resource irq_res;
>  	unsigned int reg_shift = 0;
>  	int pio_mode = 0;
>  	int pio_mask;
>  	bool use16bit;
> +	int irq;
>  
>  	ret = of_address_to_resource(dn, 0, &io_res);
>  	if (ret) {
> @@ -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);
> +	if (irq <= 0 && irq != -ENXIO)
> +		return irq ? irq : -ENXIO;

Why are you making an exception for ENXIO ? I suspect this is to cover
the case "there is no IRQ for this node", but then how does this
differentiate from a real error case ?

>  
>  	of_property_read_u32(dn, "reg-shift", &reg_shift);
>  
> @@ -63,7 +67,8 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
>  	pio_mask = 1 << pio_mode;
>  	pio_mask |= (1 << pio_mode) - 1;
>  
> -	return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq_res,
> +	return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res,
> +				     irq > 0 ? &irq_res : NULL,
>  				     reg_shift, pio_mask, &pata_platform_sht,
>  				     use16bit);
>  }
> 


-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource
  2021-12-17  0:12 [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource Lad Prabhakar
  2021-12-17  0:23 ` Damien Le Moal
@ 2021-12-17  0:39 ` Rob Herring
  2021-12-17  0:44   ` Lad, Prabhakar
  2021-12-17  9:32 ` Sergey Shtylyov
  2 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2021-12-17  0:39 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: Damien Le Moal,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	linux-kernel, Prabhakar

On Thu, Dec 16, 2021 at 6:12 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.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 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@bp.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@bp.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
> @@ -9,6 +9,7 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/of_address.h>
> +#include <linux/of_irq.h>
>  #include <linux/platform_device.h>
>  #include <linux/ata_platform.h>
>  #include <linux/libata.h>
> @@ -25,11 +26,12 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
>         struct device_node *dn = ofdev->dev.of_node;
>         struct resource io_res;
>         struct resource ctl_res;
> -       struct resource *irq_res;
> +       struct resource irq_res;
>         unsigned int reg_shift = 0;
>         int pio_mode = 0;
>         int pio_mask;
>         bool use16bit;
> +       int irq;
>
>         ret = of_address_to_resource(dn, 0, &io_res);
>         if (ret) {
> @@ -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);

No, platform_get_irq() please. I really want to get rid of the 4 users
of of_irq_to_resource() in the tree, not add more.

Yeah, that means __pata_platform_probe() needs to change, but it's all
of 2 callers. Really, I think pata_platform.c and pata_of_platform.c
should be merged. I'm guessing the separation traces back to DT using
a different bus type.

Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource
  2021-12-17  0:39 ` Rob Herring
@ 2021-12-17  0:44   ` Lad, Prabhakar
  0 siblings, 0 replies; 7+ messages in thread
From: Lad, Prabhakar @ 2021-12-17  0:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lad Prabhakar, Damien Le Moal,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	linux-kernel

Hi Rob,

On Fri, Dec 17, 2021 at 12:39 AM Rob Herring <robh+dt@kernel.org> wrote:
>
> On Thu, Dec 16, 2021 at 6:12 PM Lad Prabhakar
> <prabhakar.mahadev-lad.rj@bp.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 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@bp.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@bp.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
> > @@ -9,6 +9,7 @@
> >  #include <linux/kernel.h>
> >  #include <linux/module.h>
> >  #include <linux/of_address.h>
> > +#include <linux/of_irq.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/ata_platform.h>
> >  #include <linux/libata.h>
> > @@ -25,11 +26,12 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
> >         struct device_node *dn = ofdev->dev.of_node;
> >         struct resource io_res;
> >         struct resource ctl_res;
> > -       struct resource *irq_res;
> > +       struct resource irq_res;
> >         unsigned int reg_shift = 0;
> >         int pio_mode = 0;
> >         int pio_mask;
> >         bool use16bit;
> > +       int irq;
> >
> >         ret = of_address_to_resource(dn, 0, &io_res);
> >         if (ret) {
> > @@ -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);
>
> No, platform_get_irq() please. I really want to get rid of the 4 users
> of of_irq_to_resource() in the tree, not add more.
>
Ouch I wasn't aware of it.

> Yeah, that means __pata_platform_probe() needs to change, but it's all
> of 2 callers. Really, I think pata_platform.c and pata_of_platform.c
> should be merged. I'm guessing the separation traces back to DT using
> a different bus type.
>
Or we could fill in the IRQ resource by using platform_get_irq()
without touching __pata_platform_probe()?

Cheers,
Prabhakar

> Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource
  2021-12-17  0:23 ` Damien Le Moal
@ 2021-12-17  1:16   ` Lad, Prabhakar
  0 siblings, 0 replies; 7+ messages in thread
From: Lad, Prabhakar @ 2021-12-17  1:16 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Lad Prabhakar, linux-ide, Rob Herring, LKML

Hi Damien,

Thank you for the review.

On Fri, Dec 17, 2021 at 12:23 AM Damien Le Moal
<damien.lemoal@opensource.wdc.com> wrote:
>
> On 12/17/21 09: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
>
> s/bypassed/bypasses
> s/messed/messes
>
Ok will update this.

> > 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@bp.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@bp.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
> > @@ -9,6 +9,7 @@
> >  #include <linux/kernel.h>
> >  #include <linux/module.h>
> >  #include <linux/of_address.h>
> > +#include <linux/of_irq.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/ata_platform.h>
> >  #include <linux/libata.h>
> > @@ -25,11 +26,12 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
> >       struct device_node *dn = ofdev->dev.of_node;
> >       struct resource io_res;
> >       struct resource ctl_res;
> > -     struct resource *irq_res;
> > +     struct resource irq_res;
> >       unsigned int reg_shift = 0;
> >       int pio_mode = 0;
> >       int pio_mask;
> >       bool use16bit;
> > +     int irq;
> >
> >       ret = of_address_to_resource(dn, 0, &io_res);
> >       if (ret) {
> > @@ -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);
> > +     if (irq <= 0 && irq != -ENXIO)
> > +             return irq ? irq : -ENXIO;
>
> Why are you making an exception for ENXIO ? I suspect this is to cover
> the case "there is no IRQ for this node", but then how does this
> differentiate from a real error case ?
>
-ENXIO to handle no interrupt case. In case of actual error case we
fallback to polling mode..

> >
> >       of_property_read_u32(dn, "reg-shift", &reg_shift);
> >
> > @@ -63,7 +67,8 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
> >       pio_mask = 1 << pio_mode;
> >       pio_mask |= (1 << pio_mode) - 1;
> >
> > -     return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq_res,
> > +     return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res,
> > +                                  irq > 0 ? &irq_res : NULL,
.. here is check for irq number again.

Cheers,
Prabhakar
> >                                    reg_shift, pio_mask, &pata_platform_sht,
> >                                    use16bit);
> >  }
> >
>
>
> --
> Damien Le Moal
> Western Digital Research

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource
  2021-12-17  0:12 [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource Lad Prabhakar
  2021-12-17  0:23 ` Damien Le Moal
  2021-12-17  0:39 ` Rob Herring
@ 2021-12-17  9:32 ` Sergey Shtylyov
  2021-12-17 14:14   ` Lad, Prabhakar
  2 siblings, 1 reply; 7+ messages in thread
From: Sergey Shtylyov @ 2021-12-17  9:32 UTC (permalink / raw)
  To: Lad Prabhakar, Damien Le Moal, linux-ide
  Cc: Rob Herring, linux-kernel, Prabhakar

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@bp.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@bp.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()?

> +	if (irq <= 0 && irq != -ENXIO)
> +		return irq ? irq : -ENXIO;
>   
>   	of_property_read_u32(dn, "reg-shift", &reg_shift);
>   
[...]

MBR, Sergey

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource
  2021-12-17  9:32 ` Sergey Shtylyov
@ 2021-12-17 14:14   ` Lad, Prabhakar
  0 siblings, 0 replies; 7+ messages in thread
From: Lad, Prabhakar @ 2021-12-17 14:14 UTC (permalink / raw)
  To: Sergey Shtylyov
  Cc: Lad Prabhakar, Damien Le Moal, linux-ide, Rob Herring, LKML

Hi Sergey,

On Fri, Dec 17, 2021 at 9:33 AM Sergey Shtylyov <s.shtylyov@omp.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@bp.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@bp.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", &reg_shift);
> >
> [...]
>
> MBR, Sergey

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-17 14:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17  0:12 [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to populate IRQ resource Lad Prabhakar
2021-12-17  0:23 ` Damien Le Moal
2021-12-17  1:16   ` Lad, Prabhakar
2021-12-17  0:39 ` Rob Herring
2021-12-17  0:44   ` Lad, Prabhakar
2021-12-17  9:32 ` Sergey Shtylyov
2021-12-17 14:14   ` Lad, Prabhakar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).