From patchwork Mon Sep 26 07:21:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 9350185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8CC5C601C2 for ; Mon, 26 Sep 2016 07:23:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AFB228B05 for ; Mon, 26 Sep 2016 07:23:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FAA328B0E; Mon, 26 Sep 2016 07:23:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0492628B05 for ; Mon, 26 Sep 2016 07:23:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1boQEj-0001jo-O7; Mon, 26 Sep 2016 07:22:01 +0000 Received: from smtp02.smtpout.orange.fr ([80.12.242.124] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1boQEe-0001XL-DD for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2016 07:21:57 +0000 Received: from belgarion.home ([109.222.115.228]) by mwinf5d49 with ME id o7MX1t00D4vkSLV037MXhl; Mon, 26 Sep 2016 09:21:33 +0200 X-ME-Helo: belgarion.home X-ME-Date: Mon, 26 Sep 2016 09:21:33 +0200 X-ME-IP: 109.222.115.228 From: Robert Jarzmik To: Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: [PATCH] ARM: pxa: pxa_cplds: honor probe deferral Date: Mon, 26 Sep 2016 09:21:28 +0200 Message-Id: <1474874488-26533-1-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160926_002156_796613_B9AFF9DA X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The method to acquire the input interrupt was working in a platform data based board, but was failing in a device-tree one when the gpio controller was probed after pxa_cplds. Use platform_get_irq() to benefit from the probe deferral mechanism. Moreover, as seen in dm9000.c development, platform_get_irq() doesn't honor the irq type IO resource (ie. edge rising for example), and it must be passed again at irq request in a not device-tree build, hence the irq_get_trigger_type() call. Signed-off-by: Robert Jarzmik --- arch/arm/mach-pxa/pxa_cplds_irqs.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-pxa/pxa_cplds_irqs.c b/arch/arm/mach-pxa/pxa_cplds_irqs.c index e362f865fcd2..941508585e34 100644 --- a/arch/arm/mach-pxa/pxa_cplds_irqs.c +++ b/arch/arm/mach-pxa/pxa_cplds_irqs.c @@ -120,13 +120,9 @@ static int cplds_probe(struct platform_device *pdev) if (!fpga) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (res) { - fpga->irq = (unsigned int)res->start; - irqflags = res->flags; - } - if (!fpga->irq) - return -ENODEV; + fpga->irq = platform_get_irq(pdev, 0); + if (fpga->irq <= 0) + return fpga->irq; base_irq = platform_get_irq(pdev, 1); if (base_irq < 0) @@ -142,6 +138,7 @@ static int cplds_probe(struct platform_device *pdev) writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); writel(0, fpga->base + FPGA_IRQ_SET_CLR); + irqflags = irq_get_trigger_type(fpga->irq); ret = devm_request_irq(&pdev->dev, fpga->irq, cplds_irq_handler, irqflags, dev_name(&pdev->dev), fpga); if (ret == -ENOSYS)