From patchwork Tue Sep 6 19:20:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101838 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp706227qgf; Tue, 6 Sep 2016 12:20:36 -0700 (PDT) X-Received: by 10.66.163.129 with SMTP id yi1mr9566335pab.47.1473189636359; Tue, 06 Sep 2016 12:20:36 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si36575230paf.280.2016.09.06.12.20.36; Tue, 06 Sep 2016 12:20:36 -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 S965379AbcIFTUe (ORCPT + 4 others); Tue, 6 Sep 2016 15:20:34 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:59088 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755902AbcIFTUc (ORCPT ); Tue, 6 Sep 2016 15:20:32 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0Lz2g4-1b3yfH137w-014CEw; Tue, 06 Sep 2016 21:20:23 +0200 From: Arnd Bergmann To: "David S . Miller" Cc: Arnd Bergmann , Richard Cochran , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] ptp: ixp46x: remove NO_IRQ handling Date: Tue, 6 Sep 2016 21:20:36 +0200 Message-Id: <20160906192053.1061021-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:I+iAxm/ngdLl+J0lMBvM0fwjxz06B1BujdV2vi3+zXiTW0Cc0Ot Zg0pufPY464t6iMvqF3IIPSF0JsR6kJzoDDydKZ5htNrc8FB69wi+mBwMPIOwRcvoJ/kWFG lmWl+9IZmpF7FFdkCsrIfpSTwpVGINIS9iRU+LeqSs5zzVXPGtjGUtYPNQDMmdZt76ROFPw Y+dPNSQlFG5GwPWxAnaOA== X-UI-Out-Filterresults: notjunk:1; V01:K0:WPktmKD1WPA=:l5Hiwa4xlP5i+8GYjE6Cks hbiUSNmZjU+Q9IReoJ+tHL7Htx6TK6P0tesimlT2iTfcyKp1MF0rTQcNRIEijpxnhE2mDA2EJ 3M6QA0i6n/PfcXtt/XDdwkTJI6DWuxjrAElNLfC6lxf3wNR3XfwcO/X6StNETinzYT9miFcCj U0GuIhS3P33thT5kfYX36G1ElM52JKZ3c7GV069Jt356PoUgUM3zCUxY2gdDLy5g1TaW7IQpe ud88kqiUZYa+KQi2iFTiPpP57O0ogthdkXbcCQavi4nyKt3CPuoK2ZXAhFBxMU2tLEw/+oMYD Kp6tJNP7aubdchSkAfvL1iesrzlraE8W7V4zz9CRRbm0Ywsw2CFLSzEf1lEajbEvP0io+cCYK 4W6owKpB2EIanqyUf9uv8m17Fa2LEKDhwCm6LxcAxey4KFFTc4j+M9wJUXUvSjvO5K1uz0imN lNGQT3z3t/tLvpp0xtcBXP46Dmqtyyy3YVcYOiq4GbzlG+00vxkLnRwPpBfd04DktgJvxlop5 aGQdLCKBN4hlOoKHO5JV7EX+mWHimzlCqcPSwvjAihT2n8MkeeNZ2QxbmugmJwg3Z+oyWEag5 MAfVkkWsfyo/V4mzuTVRYoUZvoyn8PWrJZHh7Q+TPPZO6okx4T2LQP2GMlsNiuaxcVRY3e8Tk /G9IE2BCCGhBqeXN3JMW4za6a7i/TVtdgtfzQ7Ph3yfiDPu7HporxdamkaydqTJSxHJc= 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 Acked-by: Richard Cochran --- drivers/ptp/ptp_ixp46x.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) v2: fix trivial typo -- 2.9.0 diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c index ee4f183ef9ee..344a3bac210b 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;