mbox series

[v2,00/13] media: Use platform_get_irq*() variants to fetch IRQ's

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

Message

Prabhakar Mahadev Lad Jan. 11, 2022, 12:23 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/

Cheers,
Prabhakar

Lad Prabhakar (13):
  media: vsp1: Use platform_get_irq() to get the interrupt
  media: camss: Use platform_get_irq_byname() to get the interrupt
  media: bdisp: Use platform_get_irq() to get the interrupt
  media: s5p-mfc: Use platform_get_irq() to get the interrupt
  media: stm32-dma2d: Use platform_get_irq() to get the interrupt
  media: davinci: vpif: Use platform_get_irq_optional() to get the
    interrupt
  media: exynos-gsc: Use platform_get_irq() to get the interrupt
  media: marvell-ccic: Use platform_get_irq() to get the interrupt
  media: mtk-vcodec: Drop unnecessary call to platform_get_resource()
  media: exynos4-is: Use platform_get_irq() to get the interrupt
  media: s5p-g2d: Use platform_get_irq() to get the interrupt
  media: mtk-vpu: Drop unnecessary call to platform_get_resource()
  media: coda: Use platform_get_irq() to get the interrupt

 drivers/media/platform/coda/imx-vdoa.c        |  9 ++++---
 drivers/media/platform/davinci/vpif.c         | 18 ++++++++------
 drivers/media/platform/davinci/vpif_capture.c | 24 ++++++++++++-------
 drivers/media/platform/davinci/vpif_display.c | 21 ++++++++++------
 drivers/media/platform/exynos-gsc/gsc-core.c  | 14 +++++------
 drivers/media/platform/exynos4-is/fimc-core.c | 11 ++++-----
 drivers/media/platform/exynos4-is/fimc-lite.c | 11 ++++-----
 .../media/platform/marvell-ccic/mmp-driver.c  |  8 +++----
 .../platform/mtk-vcodec/mtk_vcodec_dec_drv.c  | 11 ++++-----
 .../platform/mtk-vcodec/mtk_vcodec_enc_drv.c  | 10 +++-----
 drivers/media/platform/mtk-vpu/mtk_vpu.c      | 10 +++-----
 .../media/platform/qcom/camss/camss-csid.c    | 12 ++++------
 .../media/platform/qcom/camss/camss-csiphy.c  | 12 ++++------
 .../media/platform/qcom/camss/camss-ispif.c   | 12 ++++------
 drivers/media/platform/qcom/camss/camss-vfe.c | 12 ++++------
 drivers/media/platform/s5p-g2d/g2d.c          | 10 +++-----
 drivers/media/platform/s5p-mfc/s5p_mfc.c      | 11 ++++-----
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 10 +++-----
 drivers/media/platform/stm32/dma2d/dma2d.c    |  9 +++----
 drivers/media/platform/vsp1/vsp1_drv.c        | 14 +++++------
 20 files changed, 108 insertions(+), 141 deletions(-)

Comments

Hans Verkuil Jan. 13, 2022, 1:05 p.m. UTC | #1
Hi Prabhakar,

I'm skipping this patch since if I am not mistaken this patch fixes this as well
(as part of a larger overhaul):

https://patchwork.linuxtv.org/project/linux-media/patch/20220113041055.25213-9-yunfei.dong@mediatek.com/

I posted a PR for that series, so that's on the way in.

Please confirm so I can mark your patch as Superseded.

Regards,

	Hans

On 11/01/2022 01:23, Lad Prabhakar wrote:
> mtk_vcodec_probe() calls platform_get_resource(pdev, IORESOURCE_IRQ, ..)
> to check if IRQ resource exists and later calls platform_get_irq(pdev, ..)
> to get the actual IRQ.
> 
> This patch drops an unnecessary call to platform_get_resource() and
> checks the return value of platform_get_irq(pdev, ..) to check if the
> IRQ line is valid.
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> v1->v2
> * No change.
> ---
>  .../media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c    | 11 ++++-------
>  .../media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c    | 10 +++-------
>  2 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> index 40c39e1e596b..1509c2a4de84 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> @@ -200,7 +200,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
>  {
>  	struct mtk_vcodec_dev *dev;
>  	struct video_device *vfd_dec;
> -	struct resource *res;
>  	phandle rproc_phandle;
>  	enum mtk_vcodec_fw_type fw_type;
>  	int i, ret;
> @@ -244,14 +243,12 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
>  		mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]);
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	if (res == NULL) {
> -		dev_err(&pdev->dev, "failed to get irq resource");
> -		ret = -ENOENT;
> +	ret = platform_get_irq(pdev, 0);
> +	if (ret < 0)
>  		goto err_res;
> -	}
>  
> -	dev->dec_irq = platform_get_irq(pdev, 0);
> +	dev->dec_irq = ret;
> +
>  	irq_set_status_flags(dev->dec_irq, IRQ_NOAUTOEN);
>  	ret = devm_request_irq(&pdev->dev, dev->dec_irq,
>  			mtk_vcodec_dec_irq_handler, 0, pdev->name, dev);
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
> index aeaecb8d416e..86e70d826754 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
> @@ -236,7 +236,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
>  {
>  	struct mtk_vcodec_dev *dev;
>  	struct video_device *vfd_enc;
> -	struct resource *res;
>  	phandle rproc_phandle;
>  	enum mtk_vcodec_fw_type fw_type;
>  	int ret;
> @@ -280,14 +279,11 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
>  		goto err_res;
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	if (res == NULL) {
> -		dev_err(&pdev->dev, "failed to get irq resource");
> -		ret = -ENOENT;
> +	ret = platform_get_irq(pdev, 0);
> +	if (ret < 0)
>  		goto err_res;
> -	}
>  
> -	dev->enc_irq = platform_get_irq(pdev, 0);
> +	dev->enc_irq = ret;
>  	irq_set_status_flags(dev->enc_irq, IRQ_NOAUTOEN);
>  	ret = devm_request_irq(&pdev->dev, dev->enc_irq,
>  			       mtk_vcodec_enc_irq_handler,