linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 04/13] media: s5p-mfc: Use platform_get_irq() to get the interrupt
       [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
@ 2021-12-23 17:30 ` Lad Prabhakar
  2021-12-28  8:42   ` Andrzej Hajda
  2021-12-23 17:30 ` [PATCH 05/13] media: stm32-dma2d: " Lad Prabhakar
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 9+ messages in thread
From: Lad Prabhakar @ 2021-12-23 17:30 UTC (permalink / raw)
  To: linux-media, Marek Szyprowski, Andrzej Hajda, Mauro Carvalho Chehab
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, Lad Prabhakar, linux-arm-kernel

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>
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index f6732f031e96..761341934925 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1268,7 +1268,6 @@ static int s5p_mfc_probe(struct platform_device *pdev)
 {
 	struct s5p_mfc_dev *dev;
 	struct video_device *vfd;
-	struct resource *res;
 	int ret;
 
 	pr_debug("%s++\n", __func__);
@@ -1294,12 +1293,10 @@ static int s5p_mfc_probe(struct platform_device *pdev)
 	if (IS_ERR(dev->regs_base))
 		return PTR_ERR(dev->regs_base);
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "failed to get irq resource\n");
-		return -ENOENT;
-	}
-	dev->irq = res->start;
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
+		return ret;
+	dev->irq = ret;
 	ret = devm_request_irq(&pdev->dev, dev->irq, s5p_mfc_irq,
 					0, pdev->name, dev);
 	if (ret) {
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 05/13] media: stm32-dma2d: Use platform_get_irq() to get the interrupt
       [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
  2021-12-23 17:30 ` [PATCH 04/13] media: s5p-mfc: Use platform_get_irq() to get the interrupt Lad Prabhakar
@ 2021-12-23 17:30 ` Lad Prabhakar
  2021-12-23 17:30 ` [PATCH 07/13] media: exynos-gsc: " Lad Prabhakar
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Lad Prabhakar @ 2021-12-23 17:30 UTC (permalink / raw)
  To: linux-media, Mauro Carvalho Chehab, Maxime Coquelin, Alexandre Torgue
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, Lad Prabhakar, linux-stm32, linux-arm-kernel

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>
---
 drivers/media/platform/stm32/dma2d/dma2d.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/stm32/dma2d/dma2d.c b/drivers/media/platform/stm32/dma2d/dma2d.c
index 17af90d86898..9706aa41b5d2 100644
--- a/drivers/media/platform/stm32/dma2d/dma2d.c
+++ b/drivers/media/platform/stm32/dma2d/dma2d.c
@@ -633,14 +633,11 @@ static int dma2d_probe(struct platform_device *pdev)
 		goto put_clk_gate;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "failed to find IRQ\n");
-		ret = -ENXIO;
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
 		goto unprep_clk_gate;
-	}
 
-	dev->irq = res->start;
+	dev->irq = ret;
 
 	ret = devm_request_irq(&pdev->dev, dev->irq, dma2d_isr,
 			       0, pdev->name, dev);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 07/13] media: exynos-gsc: Use platform_get_irq() to get the interrupt
       [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
  2021-12-23 17:30 ` [PATCH 04/13] media: s5p-mfc: Use platform_get_irq() to get the interrupt Lad Prabhakar
  2021-12-23 17:30 ` [PATCH 05/13] media: stm32-dma2d: " Lad Prabhakar
@ 2021-12-23 17:30 ` Lad Prabhakar
  2021-12-23 17:30 ` [PATCH 09/13] media: mtk-vcodec: Drop unnecessary call to platform_get_resource() Lad Prabhakar
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Lad Prabhakar @ 2021-12-23 17:30 UTC (permalink / raw)
  To: linux-media, Mauro Carvalho Chehab, Krzysztof Kozlowski
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, Lad Prabhakar, linux-arm-kernel,
	linux-samsung-soc

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>
---
 drivers/media/platform/exynos-gsc/gsc-core.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index cfd6ae70b8d8..e3559b047092 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -1106,9 +1106,9 @@ MODULE_DEVICE_TABLE(of, exynos_gsc_match);
 static int gsc_probe(struct platform_device *pdev)
 {
 	struct gsc_dev *gsc;
-	struct resource *res;
 	struct device *dev = &pdev->dev;
 	const struct gsc_driverdata *drv_data = of_device_get_match_data(dev);
+	int irq;
 	int ret;
 	int i;
 
@@ -1141,11 +1141,9 @@ static int gsc_probe(struct platform_device *pdev)
 	if (IS_ERR(gsc->regs))
 		return PTR_ERR(gsc->regs);
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res) {
-		dev_err(dev, "failed to get IRQ resource\n");
-		return -ENXIO;
-	}
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	for (i = 0; i < gsc->num_clocks; i++) {
 		gsc->clock[i] = devm_clk_get(dev, drv_data->clk_names[i]);
@@ -1167,8 +1165,8 @@ static int gsc_probe(struct platform_device *pdev)
 		}
 	}
 
-	ret = devm_request_irq(dev, res->start, gsc_irq_handler,
-				0, pdev->name, gsc);
+	ret = devm_request_irq(dev, irq, gsc_irq_handler,
+			       0, pdev->name, gsc);
 	if (ret) {
 		dev_err(dev, "failed to install irq (%d)\n", ret);
 		goto err_clk;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 09/13] media: mtk-vcodec: Drop unnecessary call to platform_get_resource()
       [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
                   ` (2 preceding siblings ...)
  2021-12-23 17:30 ` [PATCH 07/13] media: exynos-gsc: " Lad Prabhakar
@ 2021-12-23 17:30 ` Lad Prabhakar
  2021-12-23 17:30 ` [PATCH 10/13] media: exynos4-is: Use platform_get_irq() to get the interrupt Lad Prabhakar
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Lad Prabhakar @ 2021-12-23 17:30 UTC (permalink / raw)
  To: linux-media, Tiffany Lin, Andrew-CT Chen, Mauro Carvalho Chehab,
	Matthias Brugger
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, Lad Prabhakar, linux-arm-kernel,
	linux-mediatek

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>
---
 .../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,
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 10/13] media: exynos4-is: Use platform_get_irq() to get the interrupt
       [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
                   ` (3 preceding siblings ...)
  2021-12-23 17:30 ` [PATCH 09/13] media: mtk-vcodec: Drop unnecessary call to platform_get_resource() Lad Prabhakar
@ 2021-12-23 17:30 ` Lad Prabhakar
  2021-12-23 17:30 ` [PATCH 11/13] media: s5p-g2d: " Lad Prabhakar
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Lad Prabhakar @ 2021-12-23 17:30 UTC (permalink / raw)
  To: linux-media, Sylwester Nawrocki, Mauro Carvalho Chehab,
	Krzysztof Kozlowski
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, Lad Prabhakar, linux-arm-kernel,
	linux-samsung-soc

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>
---
 drivers/media/platform/exynos4-is/fimc-core.c | 11 +++++------
 drivers/media/platform/exynos4-is/fimc-lite.c | 11 +++++------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c
index bfdee771cef9..91cc8d58a663 100644
--- a/drivers/media/platform/exynos4-is/fimc-core.c
+++ b/drivers/media/platform/exynos4-is/fimc-core.c
@@ -926,6 +926,7 @@ static int fimc_probe(struct platform_device *pdev)
 	struct fimc_dev *fimc;
 	struct resource *res;
 	int ret = 0;
+	int irq;
 
 	fimc = devm_kzalloc(dev, sizeof(*fimc), GFP_KERNEL);
 	if (!fimc)
@@ -965,11 +966,9 @@ static int fimc_probe(struct platform_device *pdev)
 	if (IS_ERR(fimc->regs))
 		return PTR_ERR(fimc->regs);
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (res == NULL) {
-		dev_err(dev, "Failed to get IRQ resource\n");
-		return -ENXIO;
-	}
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	ret = fimc_clk_get(fimc);
 	if (ret)
@@ -986,7 +985,7 @@ static int fimc_probe(struct platform_device *pdev)
 	if (ret < 0)
 		return ret;
 
-	ret = devm_request_irq(dev, res->start, fimc_irq_handler,
+	ret = devm_request_irq(dev, irq, fimc_irq_handler,
 			       0, dev_name(dev), fimc);
 	if (ret < 0) {
 		dev_err(dev, "failed to install irq (%d)\n", ret);
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index aaa3af0493ce..9b7cc9564cf1 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -1454,6 +1454,7 @@ static int fimc_lite_probe(struct platform_device *pdev)
 	struct fimc_lite *fimc;
 	struct resource *res;
 	int ret;
+	int irq;
 
 	if (!dev->of_node)
 		return -ENODEV;
@@ -1485,17 +1486,15 @@ static int fimc_lite_probe(struct platform_device *pdev)
 	if (IS_ERR(fimc->regs))
 		return PTR_ERR(fimc->regs);
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (res == NULL) {
-		dev_err(dev, "Failed to get IRQ resource\n");
-		return -ENXIO;
-	}
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	ret = fimc_lite_clk_get(fimc);
 	if (ret)
 		return ret;
 
-	ret = devm_request_irq(dev, res->start, flite_irq_handler,
+	ret = devm_request_irq(dev, irq, flite_irq_handler,
 			       0, dev_name(dev), fimc);
 	if (ret) {
 		dev_err(dev, "Failed to install irq (%d)\n", ret);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 11/13] media: s5p-g2d: Use platform_get_irq() to get the interrupt
       [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
                   ` (4 preceding siblings ...)
  2021-12-23 17:30 ` [PATCH 10/13] media: exynos4-is: Use platform_get_irq() to get the interrupt Lad Prabhakar
@ 2021-12-23 17:30 ` Lad Prabhakar
  2021-12-23 17:30 ` [PATCH 12/13] media: mtk-vpu: Drop unnecessary call to platform_get_resource() Lad Prabhakar
  2021-12-23 17:30 ` [PATCH 13/13] media: coda: Use platform_get_irq() to get the interrupt Lad Prabhakar
  7 siblings, 0 replies; 9+ messages in thread
From: Lad Prabhakar @ 2021-12-23 17:30 UTC (permalink / raw)
  To: linux-media, Łukasz Stelmach, Mauro Carvalho Chehab
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, Lad Prabhakar, linux-arm-kernel

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>
---
 drivers/media/platform/s5p-g2d/g2d.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c
index fa0bb31bd2b9..dd8864779a7c 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -623,7 +623,6 @@ static int g2d_probe(struct platform_device *pdev)
 {
 	struct g2d_dev *dev;
 	struct video_device *vfd;
-	struct resource *res;
 	const struct of_device_id *of_id;
 	int ret = 0;
 
@@ -664,14 +663,11 @@ static int g2d_probe(struct platform_device *pdev)
 		goto put_clk_gate;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "failed to find IRQ\n");
-		ret = -ENXIO;
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
 		goto unprep_clk_gate;
-	}
 
-	dev->irq = res->start;
+	dev->irq = ret;
 
 	ret = devm_request_irq(&pdev->dev, dev->irq, g2d_isr,
 						0, pdev->name, dev);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 12/13] media: mtk-vpu: Drop unnecessary call to platform_get_resource()
       [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
                   ` (5 preceding siblings ...)
  2021-12-23 17:30 ` [PATCH 11/13] media: s5p-g2d: " Lad Prabhakar
@ 2021-12-23 17:30 ` Lad Prabhakar
  2021-12-23 17:30 ` [PATCH 13/13] media: coda: Use platform_get_irq() to get the interrupt Lad Prabhakar
  7 siblings, 0 replies; 9+ messages in thread
From: Lad Prabhakar @ 2021-12-23 17:30 UTC (permalink / raw)
  To: linux-media, Tiffany Lin, Andrew-CT Chen, Minghsiu Tsai,
	Houlong Wei, Mauro Carvalho Chehab, Matthias Brugger
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, Lad Prabhakar, linux-arm-kernel,
	linux-mediatek

mtk_vpu_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 make sure the
IRQ line is valid.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/media/platform/mtk-vpu/mtk_vpu.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c
index 7bd715fc844d..47b684b92f81 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
@@ -810,7 +810,6 @@ static int mtk_vpu_probe(struct platform_device *pdev)
 {
 	struct mtk_vpu *vpu;
 	struct device *dev;
-	struct resource *res;
 	int ret = 0;
 
 	dev_dbg(&pdev->dev, "initialization\n");
@@ -908,13 +907,10 @@ static int mtk_vpu_probe(struct platform_device *pdev)
 	init_waitqueue_head(&vpu->run.wq);
 	init_waitqueue_head(&vpu->ack_wq);
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res) {
-		dev_err(dev, "get IRQ resource failed.\n");
-		ret = -ENXIO;
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
 		goto free_p_mem;
-	}
-	vpu->reg.irq = platform_get_irq(pdev, 0);
+	vpu->reg.irq = ret;
 	ret = devm_request_irq(dev, vpu->reg.irq, vpu_irq_handler, 0,
 			       pdev->name, vpu);
 	if (ret) {
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 13/13] media: coda: Use platform_get_irq() to get the interrupt
       [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
                   ` (6 preceding siblings ...)
  2021-12-23 17:30 ` [PATCH 12/13] media: mtk-vpu: Drop unnecessary call to platform_get_resource() Lad Prabhakar
@ 2021-12-23 17:30 ` Lad Prabhakar
  7 siblings, 0 replies; 9+ messages in thread
From: Lad Prabhakar @ 2021-12-23 17:30 UTC (permalink / raw)
  To: linux-media, Philipp Zabel, Mauro Carvalho Chehab, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, Lad Prabhakar, linux-arm-kernel

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>
---
 drivers/media/platform/coda/imx-vdoa.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/coda/imx-vdoa.c b/drivers/media/platform/coda/imx-vdoa.c
index 00643f37b3e6..c70871bae193 100644
--- a/drivers/media/platform/coda/imx-vdoa.c
+++ b/drivers/media/platform/coda/imx-vdoa.c
@@ -284,7 +284,6 @@ EXPORT_SYMBOL(vdoa_context_configure);
 static int vdoa_probe(struct platform_device *pdev)
 {
 	struct vdoa_data *vdoa;
-	struct resource *res;
 	int ret;
 
 	ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
@@ -309,10 +308,10 @@ static int vdoa_probe(struct platform_device *pdev)
 	if (IS_ERR(vdoa->regs))
 		return PTR_ERR(vdoa->regs);
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res)
-		return -EINVAL;
-	ret = devm_request_threaded_irq(&pdev->dev, res->start, NULL,
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
+		return ret;
+	ret = devm_request_threaded_irq(&pdev->dev, ret, NULL,
 					vdoa_irq_handler, IRQF_ONESHOT,
 					"vdoa", vdoa);
 	if (ret < 0) {
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 04/13] media: s5p-mfc: Use platform_get_irq() to get the interrupt
  2021-12-23 17:30 ` [PATCH 04/13] media: s5p-mfc: Use platform_get_irq() to get the interrupt Lad Prabhakar
@ 2021-12-28  8:42   ` Andrzej Hajda
  0 siblings, 0 replies; 9+ messages in thread
From: Andrzej Hajda @ 2021-12-28  8:42 UTC (permalink / raw)
  To: Lad Prabhakar, linux-media, Marek Szyprowski, Mauro Carvalho Chehab
  Cc: Hans Verkuil, Rob Herring, linux-kernel, Prabhakar,
	linux-renesas-soc, linux-arm-kernel


On 23.12.2021 18:30, 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().
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards

Andrzej

> ---
>   drivers/media/platform/s5p-mfc/s5p_mfc.c | 11 ++++-------
>   1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index f6732f031e96..761341934925 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -1268,7 +1268,6 @@ static int s5p_mfc_probe(struct platform_device *pdev)
>   {
>   	struct s5p_mfc_dev *dev;
>   	struct video_device *vfd;
> -	struct resource *res;
>   	int ret;
>   
>   	pr_debug("%s++\n", __func__);
> @@ -1294,12 +1293,10 @@ static int s5p_mfc_probe(struct platform_device *pdev)
>   	if (IS_ERR(dev->regs_base))
>   		return PTR_ERR(dev->regs_base);
>   
> -	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	if (!res) {
> -		dev_err(&pdev->dev, "failed to get irq resource\n");
> -		return -ENOENT;
> -	}
> -	dev->irq = res->start;
> +	ret = platform_get_irq(pdev, 0);
> +	if (ret < 0)
> +		return ret;
> +	dev->irq = ret;
>   	ret = devm_request_irq(&pdev->dev, dev->irq, s5p_mfc_irq,
>   					0, pdev->name, dev);
>   	if (ret) {

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-12-28  8:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
2021-12-23 17:30 ` [PATCH 04/13] media: s5p-mfc: Use platform_get_irq() to get the interrupt Lad Prabhakar
2021-12-28  8:42   ` Andrzej Hajda
2021-12-23 17:30 ` [PATCH 05/13] media: stm32-dma2d: " Lad Prabhakar
2021-12-23 17:30 ` [PATCH 07/13] media: exynos-gsc: " Lad Prabhakar
2021-12-23 17:30 ` [PATCH 09/13] media: mtk-vcodec: Drop unnecessary call to platform_get_resource() Lad Prabhakar
2021-12-23 17:30 ` [PATCH 10/13] media: exynos4-is: Use platform_get_irq() to get the interrupt Lad Prabhakar
2021-12-23 17:30 ` [PATCH 11/13] media: s5p-g2d: " Lad Prabhakar
2021-12-23 17:30 ` [PATCH 12/13] media: mtk-vpu: Drop unnecessary call to platform_get_resource() Lad Prabhakar
2021-12-23 17:30 ` [PATCH 13/13] media: coda: Use platform_get_irq() to get the interrupt 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).