mbox series

[0/6] usb: sound/soc: Use platform_get_irq*() variants to fetch IRQ's

Message ID 20211220010411.12075-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Headers show
Series usb: sound/soc: Use platform_get_irq*() variants to fetch IRQ's | expand

Message

Prabhakar Mahadev Lad Dec. 20, 2021, 1:04 a.m. UTC
Hi All,

This patch series aims to drop using platform_get_resource() for IRQ types
in preparation for removal of static setup of IRQ resource from DT core
code.

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/

Note: I have just build tested the patches.

Cheers,
Prabhakar

Lad Prabhakar (6):
  usb: host: fotg210: Use platform_get_irq() to get the interrupt
  usb: renesas_usbhs: Use platform_get_irq() to get the interrupt
  usb: dwc3: Drop unneeded calls to platform_get_resource_byname()
  usb: isp1760: Use platform_get_irq() to get the interrupt
  usb: cdns3: Use platform_get_irq_byname() to get the interrupt
  usb: musb: dsps: Use platform_get_irq_byname() to get the interrupt

 drivers/usb/cdns3/cdns3-plat.c     | 14 ++++++----
 drivers/usb/dwc3/host.c            | 45 +++++++++++++++++-------------
 drivers/usb/host/fotg210-hcd.c     | 11 ++------
 drivers/usb/isp1760/isp1760-if.c   | 16 +++++------
 drivers/usb/musb/musb_dsps.c       | 15 ++++++----
 drivers/usb/renesas_usbhs/common.c | 14 ++++------
 drivers/usb/renesas_usbhs/common.h |  1 -
 drivers/usb/renesas_usbhs/mod.c    | 14 +---------
 8 files changed, 59 insertions(+), 71 deletions(-)

Comments

Rui Miguel Silva Dec. 20, 2021, 3:37 p.m. UTC | #1
Hi Lad,
Thanks for the patch.

On Mon Dec 20, 2021 at 1:04 AM WET, 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 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(). Also use irq_get_trigger_type to get the
> IRQ trigger flags.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

LGTM.
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>

------
Cheers,
     Rui

> ---
>  drivers/usb/isp1760/isp1760-if.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/usb/isp1760/isp1760-if.c b/drivers/usb/isp1760/isp1760-if.c
> index 7cc349c0b2ad..65ba5aca2a4f 100644
> --- a/drivers/usb/isp1760/isp1760-if.c
> +++ b/drivers/usb/isp1760/isp1760-if.c
> @@ -13,6 +13,7 @@
>  
>  #include <linux/usb.h>
>  #include <linux/io.h>
> +#include <linux/irq.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
> @@ -191,17 +192,15 @@ static int isp1760_plat_probe(struct platform_device *pdev)
>  	unsigned long irqflags;
>  	unsigned int devflags = 0;
>  	struct resource *mem_res;
> -	struct resource *irq_res;
> +	int irq;
>  	int ret;
>  
>  	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  
> -	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	if (!irq_res) {
> -		pr_warn("isp1760: IRQ resource not available\n");
> -		return -ENODEV;
> -	}
> -	irqflags = irq_res->flags & IRQF_TRIGGER_MASK;
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0)
> +		return irq;
> +	irqflags = irq_get_trigger_type(irq);
>  
>  	if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) {
>  		struct device_node *dp = pdev->dev.of_node;
> @@ -239,8 +238,7 @@ static int isp1760_plat_probe(struct platform_device *pdev)
>  		return -ENXIO;
>  	}
>  
> -	ret = isp1760_register(mem_res, irq_res->start, irqflags, &pdev->dev,
> -			       devflags);
> +	ret = isp1760_register(mem_res, irq, irqflags, &pdev->dev, devflags);
>  	if (ret < 0)
>  		return ret;
>  
> -- 
> 2.17.1
Greg Kroah-Hartman Dec. 21, 2021, 7:51 a.m. UTC | #2
On Mon, Dec 20, 2021 at 01:04:05AM +0000, Lad Prabhakar wrote:
> Hi All,
> 
> This patch series aims to drop using platform_get_resource() for IRQ types
> in preparation for removal of static setup of IRQ resource from DT core
> code.
> 
> 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/
> 
> Note: I have just build tested the patches.

I don't think "sound/soc" mattered here in your subject line :)

I'll go queue these up now, thanks.

greg k-h