From patchwork Tue Sep 6 13:53:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101848 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp562482qgf; Tue, 6 Sep 2016 06:57:06 -0700 (PDT) X-Received: by 10.66.163.129 with SMTP id yi1mr7063945pab.47.1473170226080; Tue, 06 Sep 2016 06:57:06 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 136si5187778pfu.115.2016.09.06.06.57.05; Tue, 06 Sep 2016 06:57:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756325AbcIFN4q (ORCPT + 27 others); Tue, 6 Sep 2016 09:56:46 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:56581 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756272AbcIFN4n (ORCPT ); Tue, 6 Sep 2016 09:56:43 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0LbDic-1bE0ew2cwM-00kz8Y; Tue, 06 Sep 2016 15:56:16 +0200 From: Arnd Bergmann To: Russell King Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] ARM: common/locomo: remove NO_IRQ check Date: Tue, 6 Sep 2016 15:53:28 +0200 Message-Id: <20160906135637.2622666-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160906135637.2622666-1-arnd@arndb.de> References: <20160906135637.2622666-1-arnd@arndb.de> X-Provags-ID: V03:K0:FDUqvcYbb3a8xsCKrYgZc8wpIyVEzKmCPZIc+ioWaAG208LzruS Awpvnheqgp9X+pOZ5dDz1AIA+ReO+l6jJS02nJLca0qNXYj++/3x4nvC5e8qv8BOCN3hezd u9nn11dELXO78bcNxFTXlB3LQq9Bab7SGyZUeaYAY/5W+sLiJfO9vykKucidVj9pDAblBKo 3JibvUZNCSSGwZVuhJahw== X-UI-Out-Filterresults: notjunk:1; V01:K0:2YVlj6ofgo8=:49ZGaQq3FqAPIWRQAxzCCt JMz7HqJm3BwBW6tUlRJGdqqh4CybkgxcXDwsJtY9zrJpKuPZ02TABYKvR7bAiRuDq9LJmSDDe Uqm3jKpez2gLD7mQx1i15WnfFC5BQO/RhT2pp/7TjsFvC+K7mAwQKDs1LLSy6QB+rD8tJRyLx AipzXyYu0ii+yB7CMM8yjG9/kTECnX06yEMiHzhvcmpgehNocvdSZJPCiyzgor/AL9UH3Z5is Mz2oI9vIqS9YYd+QciwwAHRzn+Io6RtRwLTt3+2HYs1BWdXCq5AHMiCOJCGYzaPSN8iIX7nqx +PurYadsgGJ6U9ftkDILbgzSHtTcp99Plum2dnOzN1uaKeagWtLDRomQADPe5ewVMot1F6X1X IiA7XjXmhJOzG+Lg1ujCXGzSxsu684q5Qycpk+sEuK9yD4KSe0bQnPewnehgsbBnsgzDbisi4 q8/xcVWmWdZgQcQNI8DdCm2/QOGGn7LtcT3SdoWk3SMJ5v+mSULrADrn837S1PZwPWgh/KkUP wGKXOza67KExYf90z/kY94ewkdy/OB9DiZb/QzP5yPsYxYwR9dbU5rtFk0j/+4m+Bqt9iy/Hr XkFWpFI8RLDC4SCHGPlSMo7J/Zg8sgHqEgB7IcKu0Fiic8GibVJHCPo3BITz9qwlef9fTtnpV ij+qoXqC48WsvzYLYRxnMQRC6hrwNiVjvF8K5pSma6KyriXEkyxXxKxoep7PVPEHlyC8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 489447380a29 ("[PATCH] handle errors returned by platform_get_irq*()") ten years ago, the locomo driver refuses to work without an interrupt line passed in its resources, so the check for NO_IRQ is unnecessary. We still check the irq_base argument for NO_IRQ, but as both platforms that use locomo (poodle and collie) provide both 'irq' and 'irq_base', this can be done more consistently by just checking that both are valid in the probe function and otherwise returning an error. Signed-off-by: Arnd Bergmann --- arch/arm/common/locomo.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.9.0 diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 0e97b4b871f9..81abb04e5254 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -253,8 +253,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info) dev->mapbase = 0; dev->length = info->length; - dev->irq[0] = (lchip->irq_base == NO_IRQ) ? - NO_IRQ : lchip->irq_base + info->irq[0]; + dev->irq[0] = lchip->irq_base + info->irq[0]; ret = device_register(&dev->dev); if (ret) { @@ -376,6 +375,9 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) unsigned long r; int i, ret = -ENODEV; + if (!pdata->irq_base) + return ret; + lchip = kzalloc(sizeof(struct locomo), GFP_KERNEL); if (!lchip) return -ENOMEM; @@ -387,7 +389,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) lchip->phys = mem->start; lchip->irq = irq; - lchip->irq_base = (pdata) ? pdata->irq_base : NO_IRQ; + lchip->irq_base = pdata->irq_base; /* * Map the whole region. This also maps the @@ -454,8 +456,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) * The interrupt controller must be initialised before any * other device to ensure that the interrupts are available. */ - if (lchip->irq != NO_IRQ && lchip->irq_base != NO_IRQ) - locomo_setup_irq(lchip); + locomo_setup_irq(lchip); for (i = 0; i < ARRAY_SIZE(locomo_devices); i++) locomo_init_one_child(lchip, &locomo_devices[i]); @@ -476,9 +477,7 @@ static void __locomo_remove(struct locomo *lchip) { device_for_each_child(lchip->dev, NULL, locomo_remove_child); - if (lchip->irq != NO_IRQ) { - irq_set_chained_handler_and_data(lchip->irq, NULL, NULL); - } + irq_set_chained_handler_and_data(lchip->irq, NULL, NULL); iounmap(lchip->base); kfree(lchip);