From patchwork Thu Nov 26 11:59:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 105188 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp469341lbb; Thu, 26 Nov 2015 04:00:15 -0800 (PST) X-Received: by 10.66.235.100 with SMTP id ul4mr22671697pac.142.1448539213317; Thu, 26 Nov 2015 04:00:13 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si8359075pat.36.2015.11.26.04.00.13; Thu, 26 Nov 2015 04:00:13 -0800 (PST) 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 S1751465AbbKZMAG (ORCPT + 4 others); Thu, 26 Nov 2015 07:00:06 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:49684 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbbKZMAC (ORCPT ); Thu, 26 Nov 2015 07:00:02 -0500 Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1a1vDN-0005zl-2W; Thu, 26 Nov 2015 11:59:53 +0000 Received: from broonie by debutante with local (Exim 4.86) (envelope-from ) id 1a1vDK-0001Vf-5d; Thu, 26 Nov 2015 11:59:50 +0000 From: Mark Brown To: Claudiu Manoil , Shaohui Xie , "David S . Miller" Cc: netdev@vger.kernel.org, Mark Brown Date: Thu, 26 Nov 2015 11:59:46 +0000 Message-Id: <1448539186-5756-2-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448539186-5756-1-git-send-email-broonie@kernel.org> References: <1448539186-5756-1-git-send-email-broonie@kernel.org> X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mezzanine.sirena.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Subject: [PATCH 2/2] net: fsl: Fix error checking for platform_get_irq() X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The gianfar driver has recently been enabled on arm64 but fails to build since it check the return value of platform_get_irq() against NO_IRQ. Fix this by instead checking for a negative error code. Even on ARM where this code was previously being built this check was incorrect since platform_get_irq() returns a negative error code which may not be exactly the (unsigned int)(-1) that NO_IRQ is defined to be. Signed-off-by: Mark Brown --- drivers/net/ethernet/freescale/gianfar_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c index 664d0c261269..b40fba929d65 100644 --- a/drivers/net/ethernet/freescale/gianfar_ptp.c +++ b/drivers/net/ethernet/freescale/gianfar_ptp.c @@ -467,7 +467,7 @@ static int gianfar_ptp_probe(struct platform_device *dev) etsects->irq = platform_get_irq(dev, 0); - if (etsects->irq == NO_IRQ) { + if (etsects->irq < 0) { pr_err("irq not in device tree\n"); goto no_node; }