From patchwork Tue Sep 6 14:28:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101840 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp578774qgf; Tue, 6 Sep 2016 07:28:33 -0700 (PDT) X-Received: by 10.98.206.129 with SMTP id y123mr73228527pfg.7.1473172113254; Tue, 06 Sep 2016 07:28:33 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g192si35691500pfb.119.2016.09.06.07.28.33; Tue, 06 Sep 2016 07:28:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756674AbcIFO2a (ORCPT + 4 others); Tue, 6 Sep 2016 10:28:30 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:57443 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753966AbcIFO22 (ORCPT ); Tue, 6 Sep 2016 10:28:28 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0MNQhV-1bjkKE1TuT-006ygq; Tue, 06 Sep 2016 16:28:15 +0200 From: Arnd Bergmann To: Richard Cochran Cc: Arnd Bergmann , "David S. Miller" , Kefeng Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ptp: ixp46x: remove NO_IRQ handling Date: Tue, 6 Sep 2016 16:28:30 +0200 Message-Id: <20160906142849.3297250-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:akTp3gDgGZO6HO6ibNscKDzuh+6Ad75TDVnCWgkIgYYvSdhAQ3j LcWJFCgmSzlpAXxc5mnKU28EklMFgegV+CCGdxnjcdPDN+gxoTvfeJ8rIHheDhxWcl9ReMe zP+aESzobbe6BttZ0izkO+nf4kzzjorIR3x7awY2aaXZeYpgWuy86IEFrhpyWyyHMFqhoRX sP1cZuphuRC33EpLqzLJQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:TP58pk7DJqo=:Aoa+Z9TUjAAFeDMY8lbs+c OH8z9Mya/gQY36G/iHpsyeAGaD+LLtVuR9VRWH/1gzqlAbz8vUWGeFhDayUN6JEUMr9g7gR5F L7gct+nN4uPbtSTe4WCSgNOG4byEC+qN421uML6M33Yz/VN9AQLo2VlRksBo4dhMoD+aWnaSf DhFByl5x+VJbNL3oMvgJnd6zIMizSDoeYvv5qfD0Zcw9TDQL8za5qGHu37mKOavHES50xMP/h 0VeTNyGBcvnR9I67SLZhGAbq9QJQ0eFnyxfth+JegbbbMb/vQegc9geNxh4Gw6ytMWmXTZTYM oNPdphrL2hL/87vqlqnFMLbxFm3uyxv2N+lYpQbHtfEWWqf2D5Sme76XjUWLzzzHImyLfqufW E1NbtrvjYg90r51UdeoHnPghAub+RI7LBitgMLz+0xN8/o5QYIgadyN0LgL+s7PeoFWrbIU7t 6Q8uH0pY4TGLo3YWt/4rSllcPV4/hTQ2uCHhI3jYBhCuSHteI8tQjmc+9Z4SrdbZvBe+IkFNp bHnIcqAERNw4nRk7Tz29OcOLahzlyr3gt3jzOtfFcr7XFL+Rg2/krRMTJDrPrbnU9w9OjYQtG ARnLKhezJlGZSSTwjtAX2ZFcfCeqaopIRFiA/0sJWrE03gmWtHHB/XXbKmZES/t2FuUylh8K9 xG8SCS7ERccbwZwWpiSbQMiVD44e0jSJ8t9MGTxATRiQVh+97j7DciWETN4H2QpYVDss= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org gpio_to_irq does not return NO_IRQ but instead returns a negative error code on failure. Returning NO_IRQ from the function has no negative effects as we only compare the result to the expected interrupt number, but it's better to return a proper failure code for consistency, and we should remove NO_IRQ from the kernel entirely. Signed-off-by: Arnd Bergmann --- drivers/ptp/ptp_ixp46x.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.9.0 diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c index ee4f183ef9ee..fbcb940b6348 100644 --- a/drivers/ptp/ptp_ixp46x.c +++ b/drivers/ptp/ptp_ixp46x.c @@ -268,18 +268,19 @@ static int setup_interrupt(int gpio) return err; irq = gpio_to_irq(gpio); + if (irq < 0) + return irq; - if (NO_IRQ == irq) - return NO_IRQ; - - if (irq_set_irq_type(irq, IRQF_TRIGGER_FALLING)) { + err = irq_set_irq_type(irq, IRQF_TRIGGER_FALLING); + if (err) { pr_err("cannot set trigger type for irq %d\n", irq); - return NO_IRQ; + return err; } - if (request_irq(irq, isr, 0, DRIVER, &ixp_clock)) { + err = request_irq(irq, isr, 0, DRIVER, &ixp_clock); + if (err) pr_err("request_irq failed for irq %d\n", irq); - return NO_IRQ; + return err; } return irq;