From patchwork Tue Dec 21 20:39:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 12690587 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 BDA94C433F5 for ; Tue, 21 Dec 2021 20:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234555AbhLUUj2 (ORCPT ); Tue, 21 Dec 2021 15:39:28 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:38379 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234537AbhLUUj1 (ORCPT ); Tue, 21 Dec 2021 15:39:27 -0500 X-IronPort-AV: E=Sophos;i="5.88,224,1635174000"; d="scan'208";a="104736427" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 22 Dec 2021 05:39:25 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 35CAD4008560; Wed, 22 Dec 2021 05:39:24 +0900 (JST) From: Lad Prabhakar To: Roger Quadros , Tony Lindgren , Krzysztof Kozlowski , linux-omap@vger.kernel.org Cc: Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar Subject: [PATCH 1/2] memory: omap-gpmc: Use platform_get_irq() to get the interrupt Date: Tue, 21 Dec 2021 20:39:15 +0000 Message-Id: <20211221203916.18588-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211221203916.18588-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211221203916.18588-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 Acked-by: Roger Quadros --- drivers/memory/omap-gpmc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index be0858bff4d3..56f401ba53a5 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2510,13 +2510,9 @@ static int gpmc_probe(struct platform_device *pdev) if (IS_ERR(gpmc_base)) return PTR_ERR(gpmc_base); - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res) { - dev_err(&pdev->dev, "Failed to get resource: irq\n"); - return -ENOENT; - } - - gpmc->irq = res->start; + gpmc->irq = platform_get_irq(pdev, 0); + if (gpmc->irq < 0) + return gpmc->irq; gpmc_l3_clk = devm_clk_get(&pdev->dev, "fck"); if (IS_ERR(gpmc_l3_clk)) { From patchwork Tue Dec 21 20:39:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 12690589 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 6B126C433EF for ; Tue, 21 Dec 2021 20:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234575AbhLUUj3 (ORCPT ); Tue, 21 Dec 2021 15:39:29 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:28749 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234572AbhLUUj2 (ORCPT ); Tue, 21 Dec 2021 15:39:28 -0500 X-IronPort-AV: E=Sophos;i="5.88,224,1635174000"; d="scan'208";a="104263771" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 22 Dec 2021 05:39:27 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 3D858400CA05; Wed, 22 Dec 2021 05:39:26 +0900 (JST) From: Lad Prabhakar To: Roger Quadros , Tony Lindgren , Krzysztof Kozlowski , linux-omap@vger.kernel.org Cc: Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar Subject: [PATCH 2/2] memory: omap-gpmc: Make use of the devm_platform_ioremap_resource() Date: Tue, 21 Dec 2021 20:39:16 +0000 Message-Id: <20211221203916.18588-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211221203916.18588-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211221203916.18588-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Signed-off-by: Lad Prabhakar --- drivers/memory/omap-gpmc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 56f401ba53a5..582fe102f923 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2492,7 +2492,6 @@ static int gpmc_probe(struct platform_device *pdev) { int rc; u32 l; - struct resource *res; struct gpmc_device *gpmc; gpmc = devm_kzalloc(&pdev->dev, sizeof(*gpmc), GFP_KERNEL); @@ -2502,11 +2501,7 @@ static int gpmc_probe(struct platform_device *pdev) gpmc->dev = &pdev->dev; platform_set_drvdata(pdev, gpmc); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENOENT; - - gpmc_base = devm_ioremap_resource(&pdev->dev, res); + gpmc_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(gpmc_base)) return PTR_ERR(gpmc_base);