diff mbox

[2/2] net: fsl: Fix error checking for platform_get_irq()

Message ID 1448539186-5756-2-git-send-email-broonie@kernel.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Mark Brown Nov. 26, 2015, 11:59 a.m. UTC
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 <broonie@kernel.org>
---
 drivers/net/ethernet/freescale/gianfar_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Nov. 30, 2015, 8:20 p.m. UTC | #1
From: Mark Brown <broonie@kernel.org>
Date: Thu, 26 Nov 2015 11:59:46 +0000

> 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 <broonie@kernel.org>

Applied.
--
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 mbox

Patch

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;
 	}