[PATCH] platform: goldfish: pipe: Use platform_get_irq() to get the interrupt

Lad Prabhakar posted 1 patch 4 years, 6 months ago
There is a newer version of this series
drivers/platform/goldfish/goldfish_pipe.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
[PATCH] platform: goldfish: pipe: Use platform_get_irq() to get the interrupt
Posted by Lad Prabhakar 4 years, 6 months ago
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@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/platform/goldfish/goldfish_pipe.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index b67539f9848c..7737d56191d7 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -896,11 +896,9 @@ static int goldfish_pipe_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	r = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!r)
-		return -EINVAL;
-
-	dev->irq = r->start;
+	dev->irq = platform_get_irq(pdev, 0);
+	if (dev->irq < 0)
+		return dev->irq;
 
 	/*
 	 * Exchange the versions with the host device
-- 
2.17.1

Re: [PATCH] platform: goldfish: pipe: Use platform_get_irq() to get the interrupt
Posted by Lad, Prabhakar 4 years, 3 months ago
Hi Greg,

I'm not sure how I missed you to add in the to list.

On Fri, Dec 24, 2021 at 4:13 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 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@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/platform/goldfish/goldfish_pipe.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
Do you want me to resend this patch?

Cheers,
Prabhakar

> diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
> index b67539f9848c..7737d56191d7 100644
> --- a/drivers/platform/goldfish/goldfish_pipe.c
> +++ b/drivers/platform/goldfish/goldfish_pipe.c
> @@ -896,11 +896,9 @@ static int goldfish_pipe_probe(struct platform_device *pdev)
>                 return -EINVAL;
>         }
>
> -       r = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -       if (!r)
> -               return -EINVAL;
> -
> -       dev->irq = r->start;
> +       dev->irq = platform_get_irq(pdev, 0);
> +       if (dev->irq < 0)
> +               return dev->irq;
>
>         /*
>          * Exchange the versions with the host device
> --
> 2.17.1
>
Re: [PATCH] platform: goldfish: pipe: Use platform_get_irq() to get the interrupt
Posted by Greg Kroah-Hartman 4 years, 3 months ago
On Wed, Mar 09, 2022 at 12:09:45PM +0000, Lad, Prabhakar wrote:
> Hi Greg,
> 
> I'm not sure how I missed you to add in the to list.
> 
> On Fri, Dec 24, 2021 at 4:13 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 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@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/platform/goldfish/goldfish_pipe.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> >
> Do you want me to resend this patch?

If you want me to apply it, yes.

thanks,

greg k-h