From patchwork Thu Dec 23 17:30:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lad Prabhakar X-Patchwork-Id: 12698534 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17055C433EF for ; Thu, 23 Dec 2021 17:32:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kRYVgW7ZHcfZft7tB5u0KKbtl6rcUmQp4iyBQtX+Kbc=; b=ztoT7UCy08VClV R0sy6RvvhwGStSMVGZzYO6q+bgIuXB+37+kSDLbQOV3rMFy0EdWogNBmENN1J87zdxVWzNzcqFZue RgXez71jkyA368Xp+2nh4N9bhckD12peeM3qrWbeTl6/Zr2rujGvKyHVfdbbhrSnOlyVSva9s74PV E9ACbhJnjLef5LUEPrQ66lx2dQDfUnYZwViU/zl9xnQtvWUSay5hUoNGzw8LlVfxtAvnWIZgU6Xms pFHuvZXvFJitbJniUIPYGMd9osOHh/nyzuMQfZPbA1iJecsClUiCOwD8iTKYhWUWzcDSjITj1VHBj kew7mIfQ32nwp+Uom/rA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0RvY-00DCFN-0c; Thu, 23 Dec 2021 17:30:52 +0000 Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0RvT-00DCDS-Tc for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 17:30:49 +0000 X-IronPort-AV: E=Sophos;i="5.88,230,1635174000"; d="scan'208";a="104983867" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 02:30:44 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 801B940C4A56; Fri, 24 Dec 2021 02:30:42 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Hans Verkuil , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , linux-renesas-soc@vger.kernel.org, Lad Prabhakar , linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/13] media: s5p-mfc: Use platform_get_irq() to get the interrupt Date: Thu, 23 Dec 2021 17:30:05 +0000 Message-Id: <20211223173015.22251-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_093048_086072_823A2D89 X-CRM114-Status: GOOD ( 11.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Andrzej Hajda --- 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) { From patchwork Thu Dec 23 17:30:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lad Prabhakar X-Patchwork-Id: 12698535 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80589C433F5 for ; Thu, 23 Dec 2021 17:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FlBiWjczH+YgO+ipmaBX1B7mKkOEtywcQxFUSJpi0tw=; b=LV3pKEOxVsRXjC ZQVq345oZP92pXK30FPC8WgDWGOp/9KzPtTw49Emfa5/tnZaAbnaPcUDvZOQltWzYjtVNe7/QeW/y vHnfbLtTfItdq/1UbuPSCnfZPxpxDxYj4Avcg81Qj1B2XqNyrjH2sUm5m41D+Min8VjhzOZgDVULZ V1VYgH0KB/smozqNbljJxUdWERvDyyk3F2Md6M5FFkAhbrURpvQMr+k7V+5t5oFZIpHYvo8GZlvRv zLIg80KTtDjviLbPbTqLDJ28obbRaEEyCHBastD6by3dxxiIOsejn16MjttQ/OKEgIFEX2JyVOTVy IQQ7ZB0etEBo9UpAws0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rvi-00DCJo-8P; Thu, 23 Dec 2021 17:31:02 +0000 Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0RvU-00DCEC-QW for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 17:30:50 +0000 X-IronPort-AV: E=Sophos;i="5.88,230,1635174000"; d="scan'208";a="104983876" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 02:30:48 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 9F59D40C4A40; Fri, 24 Dec 2021 02:30:45 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Maxime Coquelin , Alexandre Torgue Cc: Hans Verkuil , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , linux-renesas-soc@vger.kernel.org, Lad Prabhakar , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/13] media: stm32-dma2d: Use platform_get_irq() to get the interrupt Date: Thu, 23 Dec 2021 17:30:06 +0000 Message-Id: <20211223173015.22251-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_093048_990587_999B8590 X-CRM114-Status: GOOD ( 11.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- 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); From patchwork Thu Dec 23 17:30:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lad Prabhakar X-Patchwork-Id: 12698536 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2D6EC433F5 for ; Thu, 23 Dec 2021 17:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HKuMwDCWwkDOapUrsymvl5lqMwOlkxBRIEoElshVnZI=; b=cMuv0TD3ebtc2q muipymgjTZJuVuz0rGQDRI3oxQOgdbP8tbJBAGAyP7OhuX4CfCIAPlkR264LaU0CL47K5oHwqDiN1 /WQi825QVTHhmtQs1Ecf9FHESpFtaSgX4m3sRW1cdA45Yu/aX20uOhK3QOex3VHHtJUpWMEWdW/Rs uLzXX/2H/xkWjtgg5VJ7qVMKL+VqowdYo7+BKJF94AmEmXjkgEZ3oTvb29vxN79AFO8gS3pP40eNO TdsndXHarll6OSVgLwq6TRsjxU9rzyJHNd1KC7xUDVph48nWy+fsb5u8raUBi7o7zq92bCPxSqu0X LZQD/IZg9stBS+Y12law==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rvt-00DCNq-JZ; Thu, 23 Dec 2021 17:31:13 +0000 Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rva-00DCH1-Qo for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 17:30:56 +0000 X-IronPort-AV: E=Sophos;i="5.88,230,1635174000"; d="scan'208";a="104983888" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 02:30:54 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id C64CE40C4DA9; Fri, 24 Dec 2021 02:30:51 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Hans Verkuil , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , linux-renesas-soc@vger.kernel.org, Lad Prabhakar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 07/13] media: exynos-gsc: Use platform_get_irq() to get the interrupt Date: Thu, 23 Dec 2021 17:30:08 +0000 Message-Id: <20211223173015.22251-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_093055_014937_4F3C8D66 X-CRM114-Status: GOOD ( 14.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- 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 Thu Dec 23 17:30:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lad Prabhakar X-Patchwork-Id: 12698537 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98BE0C433EF for ; Thu, 23 Dec 2021 17:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+6FXnbHUydZx71mbEB9SQ4jq4tg3x2uQsZiJXEE6rM8=; b=zJ/TUoAZ9ugUeA LBWUOVHe1jkmTzV+gnW8OI/ytfozH2C0hsR5PDySA2VGCQceIRthPquIXB5A68rN44KfiKVEirmNP kwgEOH48cEhlVpFYWoYkCZtKYPqn2qHDUTgfQYMi0TP0vU2sQPgt5VqiUTZUwHO17tMzPKZhrN76H o8Gnmc0MsDg4F50aMDMNxtA1g31lwtJW57Gu5iMC4gjkZ41hdXAKxk4/bnROZD4Fjt1YWBiHwmpZ1 cSuPkA+puZYkWCblw9yv8g6YCMKUdEdZcDzmn52LQOK0E7YIiIbQDygPiQ+8sfUbjNDOyREhslQPE ACEpgvIvse8uij+HnQeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rw5-00DCS8-3s; Thu, 23 Dec 2021 17:31:25 +0000 Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rvg-00DCH1-PY; Thu, 23 Dec 2021 17:31:02 +0000 X-IronPort-AV: E=Sophos;i="5.88,230,1635174000"; d="scan'208";a="104983894" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 02:31:00 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id A23A640C4DA9; Fri, 24 Dec 2021 02:30:57 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Matthias Brugger Cc: Hans Verkuil , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , linux-renesas-soc@vger.kernel.org, Lad Prabhakar , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 09/13] media: mtk-vcodec: Drop unnecessary call to platform_get_resource() Date: Thu, 23 Dec 2021 17:30:10 +0000 Message-Id: <20211223173015.22251-10-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_093100_969263_6EA96C75 X-CRM114-Status: GOOD ( 11.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- .../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, From patchwork Thu Dec 23 17:30:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lad Prabhakar X-Patchwork-Id: 12698538 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4575CC433EF for ; Thu, 23 Dec 2021 17:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qEkMM6LOuFFdCa890XrZnwjGbW30TlEFANjIFSyFpl4=; b=B3BCnxMIEas9f5 Z/H5nDf3l5MRp8DUnItlJbr0rdNOo8qhNfcwZZ7DF2xoMZgCptiTXahcYEeHctDkzsLfYRRcjbkF8 kn/vflcPH2r19/yigV3jBLwYi+XFVW7QxAlcc/O9JT3ekLIIRQmJWWWhxKpRu+eJXYtAG++f1fds9 Pz7tU6JQam5kxcUjGJOXtE2nbpPvPNUy7SanIPOLaircKNtcoW5Ky4FuGlbZU24Xy0gsFftM8G+A2 evo1xMcK9AtYvRorlu4dvW37YoMxnTTOfNnC32D/AX2nrfSSFVn9gqrIl3vXIK5Al+eIJKWlaaM17 4ESxKRwiW80E8KGGlGUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0RwM-00DCXv-FX; Thu, 23 Dec 2021 17:31:42 +0000 Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rvk-00DCH1-51 for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 17:31:05 +0000 X-IronPort-AV: E=Sophos;i="5.88,230,1635174000"; d="scan'208";a="104983907" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 02:31:03 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 551B140C4DAD; Fri, 24 Dec 2021 02:31:01 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Hans Verkuil , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , linux-renesas-soc@vger.kernel.org, Lad Prabhakar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 10/13] media: exynos4-is: Use platform_get_irq() to get the interrupt Date: Thu, 23 Dec 2021 17:30:11 +0000 Message-Id: <20211223173015.22251-11-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_093104_349981_DFD1E9E6 X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- 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); From patchwork Thu Dec 23 17:30:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lad Prabhakar X-Patchwork-Id: 12698539 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29B0BC433F5 for ; Thu, 23 Dec 2021 17:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f05iNJ07oYMxI56bnRlkOVv96opyz8rjEoSmOlwmV3Y=; b=4Y5zxG+YPp0VyK B5MAisWY6DCjguCAibLZddqswtKi3u26OYDTUPfRaj+qdQN2c0Py7rPj2pFW3qng4KOGo54dfu5nj vxYY2VSlVsWhEZu9Y8mr2jpv7S8WCYhUMSojiE5vJJ3IkZjIFcWp16oUga0bA6jk/mcQmf21IYJf1 rvxs8RFMbnPmJMY7PKppbhtm21vIXnP/yMuK5lVTSxaEokMYiwzrgKQYtz6KAixD0UCV/7c77UL4+ vpLpz1PVnr6JzVJ0odLYFedDk+yHXieMb8b10otDjsJGDzn+bPCgtN+X0jbKRAw1EpJcaobBgp4+R ydJGJ7fuxHSAkUdjVmeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rwc-00DCgv-BX; Thu, 23 Dec 2021 17:31:58 +0000 Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rvn-00DCH1-21 for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 17:31:08 +0000 X-IronPort-AV: E=Sophos;i="5.88,230,1635174000"; d="scan'208";a="104983913" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 02:31:06 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 9ADFD40C4DB3; Fri, 24 Dec 2021 02:31:04 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, =?utf-8?q?=C5=81ukasz_Stelmach?= , Mauro Carvalho Chehab Cc: Hans Verkuil , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , linux-renesas-soc@vger.kernel.org, Lad Prabhakar , linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/13] media: s5p-g2d: Use platform_get_irq() to get the interrupt Date: Thu, 23 Dec 2021 17:30:12 +0000 Message-Id: <20211223173015.22251-12-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_093107_243370_C7D51D84 X-CRM114-Status: GOOD ( 12.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- 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); From patchwork Thu Dec 23 17:30:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lad Prabhakar X-Patchwork-Id: 12698565 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A797C433EF for ; Thu, 23 Dec 2021 17:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l1FCLSvjMzW0UBwq6HUqiHqIBqpES1raKahbge0DW+c=; b=FMC9giOLQ7ECE+ aN8LkNX55hJrGunPHfU2bXlwfYnRWQ3KbmQpCyaUAIhewcCOOkuxRY5M9p+5bte2yHhKCQHEalRBd 2g9A3bqle76tKvlWJxgXEPsmSDx8Ccylmf7LI/05tTKpPlq4ufPN6jouNAW+sK9E9bPU/ctLtPp+X waskA/92JRo40mL12e7syw2s76zTbJXvzI5Fq/UXnIpDGumZ0RBMk7HWQAK2ZX/gfNpQ8lMLdOLt/ IXXNSVbVwBTxOdw7ovt0nfR1l5R082XflrxKFLam4asth0lTD7aWrXve8k5b/kI7d1YQLb0FbrgXW tXiABrXE30CDLjGZfvLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rwp-00DCnq-9S; Thu, 23 Dec 2021 17:32:11 +0000 Received: from relmlor1.renesas.com ([210.160.252.171] helo=relmlie5.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rvs-00DCNb-BD; Thu, 23 Dec 2021 17:31:13 +0000 X-IronPort-AV: E=Sophos;i="5.88,230,1635174000"; d="scan'208";a="104503626" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Dec 2021 02:31:10 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 800B040C4DD0; Fri, 24 Dec 2021 02:31:07 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Tiffany Lin , Andrew-CT Chen , Minghsiu Tsai , Houlong Wei , Mauro Carvalho Chehab , Matthias Brugger Cc: Hans Verkuil , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , linux-renesas-soc@vger.kernel.org, Lad Prabhakar , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 12/13] media: mtk-vpu: Drop unnecessary call to platform_get_resource() Date: Thu, 23 Dec 2021 17:30:13 +0000 Message-Id: <20211223173015.22251-13-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_093112_533061_93C2A648 X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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) { From patchwork Thu Dec 23 17:30:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lad Prabhakar X-Patchwork-Id: 12698566 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9445FC4332F for ; Thu, 23 Dec 2021 17:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IC81sGckATP+QphOap5X4bWDBfoXv4oq1LaIemU/idI=; b=dxgFtmMBdWFK+a +kPdK1cCHIQCXMx371PadMy5NBVZqNrcS2ysGUJDuYfndMgl7rTsyBQ4Qd68x02+ztIGxZv1duWvu 1EQOA9GPE7v/YqWvIMfqx+Kn2lDBRqhvwFYfBVnDZqJhVhE9lKa1OIoYTzTeVcz1s5lznWqL95ZqR y+shINGxnLPS9um0JLRHvU/ftnInISdByrnPBumXs9zASJPJW/V+DG69M2CN7HaAROV8q/pME/gHR xGxUM5w9RH/HYja2qgMDEPTkMfQ/Hpf2/vCjgFEyw5s1gjUhMpHgVUUvsmI+p1AWPvgsNxOlycAxF rXOadJIB8KWI9qoASxew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0RxE-00DD2m-GQ; Thu, 23 Dec 2021 17:32:37 +0000 Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Rvv-00DCP7-77 for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 17:31:16 +0000 X-IronPort-AV: E=Sophos;i="5.88,230,1635174000"; d="scan'208";a="104983923" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 02:31:14 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 659A740C4DAD; Fri, 24 Dec 2021 02:31:11 +0900 (JST) From: Lad Prabhakar To: linux-media@vger.kernel.org, Philipp Zabel , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: Hans Verkuil , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , linux-renesas-soc@vger.kernel.org, Lad Prabhakar , linux-arm-kernel@lists.infradead.org Subject: [PATCH 13/13] media: coda: Use platform_get_irq() to get the interrupt Date: Thu, 23 Dec 2021 17:30:14 +0000 Message-Id: <20211223173015.22251-14-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211223173015.22251-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_093115_396958_FFDAE8C3 X-CRM114-Status: GOOD ( 12.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- 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) {