From patchwork Thu Dec 16 18:36:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 12696514 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 CE728C433EF for ; Thu, 16 Dec 2021 18:38:14 +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=m5OGScV+KVJY5AXiVF/bYbRiulbgAFmJXyPDPayn8Gg=; b=YZjuG+Fp5ZdM+d jBDg/wBs/KDFnUoy/NnV0n7lX8ppCks8UN4EqnVcWzIIdd5OQEX43IKRXghL9tr/k7atsIovBefK8 kFAPN4L8wuSwKch6C0pndziuzZkm5YPAv9a8siyRIxFY5rFxrRsWbwrCgd7a62BjzlWydQ+pU9QJ/ /WrP0SYHcLXE/c9XBOp/Bm8vU0IEmODH/NmV38uJnWZRZ7M/ER9NlSMoH1jKqWeEDUn2qA9QQXwgK qH01ZJJhSNQ9gNVx0YCI0dzOHk+jkFReulD1Dqa45jdmV6BKEruMa9TlNo+H95UUQjhbTXqYH9N+6 oKYj5RIL7aKiOaZSd4yQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxvcd-0079WV-LQ; Thu, 16 Dec 2021 18:36:55 +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 1mxvca-0079VQ-CH for linux-arm-kernel@lists.infradead.org; Thu, 16 Dec 2021 18:36:54 +0000 X-IronPort-AV: E=Sophos;i="5.88,212,1635174000"; d="scan'208";a="103741790" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 17 Dec 2021 03:36:46 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 34A06400754D; Fri, 17 Dec 2021 03:36:44 +0900 (JST) From: Lad Prabhakar To: Wim Van Sebroeck , Guenter Roeck , Krzysztof Kozlowski , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Prabhakar , Rob Herring , Lad Prabhakar Subject: [PATCH] watchdog: s3c2410: Use platform_get_irq() to get the interrupt Date: Thu, 16 Dec 2021 18:36:39 +0000 Message-Id: <20211216183639.7710-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-20211216_103652_571334_84EC0ACD X-CRM114-Status: GOOD ( 13.15 ) 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 bypassed the hierarchical setup and messed 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/watchdog/s3c2410_wdt.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 2395f353e52d..f5aced344b7b 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -513,9 +513,9 @@ static int s3c2410wdt_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct s3c2410_wdt *wdt; - struct resource *wdt_irq; unsigned int wtcon; int started = 0; + int wdt_irq; int ret; wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); @@ -536,10 +536,9 @@ static int s3c2410wdt_probe(struct platform_device *pdev) } } - wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (wdt_irq == NULL) { - dev_err(dev, "no irq resource specified\n"); - ret = -ENOENT; + wdt_irq = platform_get_irq(pdev, 0); + if (wdt_irq < 0) { + ret = wdt_irq; goto err; } @@ -592,8 +591,8 @@ static int s3c2410wdt_probe(struct platform_device *pdev) dev_info(dev, "default timer value is out of range, cannot start\n"); } - ret = devm_request_irq(dev, wdt_irq->start, s3c2410wdt_irq, 0, - pdev->name, pdev); + ret = devm_request_irq(dev, wdt_irq, s3c2410wdt_irq, 0, + pdev->name, pdev); if (ret != 0) { dev_err(dev, "failed to install irq (%d)\n", ret); goto err_cpufreq;