From patchwork Tue Jan 11 00:23:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Mahadev Lad X-Patchwork-Id: 531956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E805FC433FE for ; Tue, 11 Jan 2022 00:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345903AbiAKAXr (ORCPT ); Mon, 10 Jan 2022 19:23:47 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:20992 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1345949AbiAKAXp (ORCPT ); Mon, 10 Jan 2022 19:23:45 -0500 X-IronPort-AV: E=Sophos;i="5.88,278,1635174000"; d="scan'208";a="106050162" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 11 Jan 2022 09:23:44 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id DD2B54157D34; Tue, 11 Jan 2022 09:23:41 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Hans Verkuil , Krzysztof Kozlowski Cc: Rob Herring , Andy Shevchenko , Prabhakar , Lad Prabhakar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/13] media: exynos-gsc: Use platform_get_irq() to get the interrupt Date: Tue, 11 Jan 2022 00:23:08 +0000 Message-Id: <20220111002314.15213-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220111002314.15213-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20220111002314.15213-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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 --- v1->v2 * No change. --- 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; From patchwork Tue Jan 11 00:23:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Mahadev Lad X-Patchwork-Id: 531390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36D95C433F5 for ; Tue, 11 Jan 2022 00:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345991AbiAKAYC (ORCPT ); Mon, 10 Jan 2022 19:24:02 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:57594 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1345920AbiAKAXy (ORCPT ); Mon, 10 Jan 2022 19:23:54 -0500 X-IronPort-AV: E=Sophos;i="5.88,278,1635174000"; d="scan'208";a="106595559" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 11 Jan 2022 09:23:53 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 376C44157D34; Tue, 11 Jan 2022 09:23:51 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Hans Verkuil , Sylwester Nawrocki , Krzysztof Kozlowski Cc: Rob Herring , Andy Shevchenko , Prabhakar , Lad Prabhakar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 10/13] media: exynos4-is: Use platform_get_irq() to get the interrupt Date: Tue, 11 Jan 2022 00:23:11 +0000 Message-Id: <20220111002314.15213-11-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220111002314.15213-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20220111002314.15213-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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 --- v1->v2 * No change. --- 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);