From mboxrd@z Thu Jan 1 00:00:00 1970 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 1B4BAC433EF for ; Tue, 21 Dec 2021 21:35:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237039AbhLUVf5 (ORCPT ); Tue, 21 Dec 2021 16:35:57 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:23027 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236211AbhLUVfy (ORCPT ); Tue, 21 Dec 2021 16:35:54 -0500 X-IronPort-AV: E=Sophos;i="5.88,224,1635174000"; d="scan'208";a="104266934" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 22 Dec 2021 06:35:53 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id A77B64008C6B; Wed, 22 Dec 2021 06:35:51 +0900 (JST) From: Lad Prabhakar To: Linus Walleij , Lee Jones , linux-arm-kernel@lists.infradead.org Cc: Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar Subject: [PATCH] mfd: ab8500-core: Use platform_get_irq() to get the interrupt Date: Tue, 21 Dec 2021 21:35:47 +0000 Message-Id: <20211221213547.1553-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- Hi, Usage of platform_get_irq() 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 --- drivers/mfd/ab8500-core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index cca0aac26148..1e61c3dacb0d 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -1042,7 +1042,6 @@ static int ab8500_probe(struct platform_device *pdev) enum ab8500_version version = AB8500_VERSION_UNDEFINED; struct device_node *np = pdev->dev.of_node; struct ab8500 *ab8500; - struct resource *resource; int ret; int i; u8 value; @@ -1053,13 +1052,9 @@ static int ab8500_probe(struct platform_device *pdev) ab8500->dev = &pdev->dev; - resource = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!resource) { - dev_err(&pdev->dev, "no IRQ resource\n"); - return -ENODEV; - } - - ab8500->irq = resource->start; + ab8500->irq = platform_get_irq(pdev, 0); + if (ab8500->irq < 0) + return ab8500->irq; ab8500->read = ab8500_prcmu_read; ab8500->write = ab8500_prcmu_write; -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 48991C433EF for ; Tue, 21 Dec 2021 21:38:52 +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: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:In-Reply-To:References: List-Owner; bh=RHeJqdDcZ/6zgFcTrk+8YOdTVkIYubdQC5DgxaaO52s=; b=DDZ/DufRGU4O7s RBYOr7+bGPq13P3st8cdHyfolVA0j8KWRat8h8N6W+0f+Yj9ORMvkgYxt0/6Q+M1g5kBFOuTTBLqm wGb+kUpsdqUIwbBgFDHMmO0OaD11yKS9VqzToB+ljF4ssoO6TGF4VbpwhsJ6vh+aqOl10rRjgQUtV VPaOYw6uP9PpT0a+hQCBckpyvX+qz5OzLkNQ14BpYmFYpr+ylxukGFX4SwipJhPkS33Luy3pdekT7 nHuc8jFLy9jwXHXCVSxf0mIviGJtmuQOrN17PLx+hE1dIHvKqxaCVyybpduTjBsi6ZANDfS+7jgAi +qwzbtSuRddIKVRNWZ3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzmne-008Yis-QA; Tue, 21 Dec 2021 21:35:58 +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 1mzmna-008Yi4-4y for linux-arm-kernel@lists.infradead.org; Tue, 21 Dec 2021 21:35:56 +0000 X-IronPort-AV: E=Sophos;i="5.88,224,1635174000"; d="scan'208";a="104266934" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 22 Dec 2021 06:35:53 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id A77B64008C6B; Wed, 22 Dec 2021 06:35:51 +0900 (JST) From: Lad Prabhakar To: Linus Walleij , Lee Jones , linux-arm-kernel@lists.infradead.org Cc: Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar Subject: [PATCH] mfd: ab8500-core: Use platform_get_irq() to get the interrupt Date: Tue, 21 Dec 2021 21:35:47 +0000 Message-Id: <20211221213547.1553-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_133554_324375_166F14BD X-CRM114-Status: GOOD ( 12.42 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- Hi, Usage of platform_get_irq() 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 --- drivers/mfd/ab8500-core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index cca0aac26148..1e61c3dacb0d 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -1042,7 +1042,6 @@ static int ab8500_probe(struct platform_device *pdev) enum ab8500_version version = AB8500_VERSION_UNDEFINED; struct device_node *np = pdev->dev.of_node; struct ab8500 *ab8500; - struct resource *resource; int ret; int i; u8 value; @@ -1053,13 +1052,9 @@ static int ab8500_probe(struct platform_device *pdev) ab8500->dev = &pdev->dev; - resource = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!resource) { - dev_err(&pdev->dev, "no IRQ resource\n"); - return -ENODEV; - } - - ab8500->irq = resource->start; + ab8500->irq = platform_get_irq(pdev, 0); + if (ab8500->irq < 0) + return ab8500->irq; ab8500->read = ab8500_prcmu_read; ab8500->write = ab8500_prcmu_write; -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel