Skip to content

Commit

Permalink
net: fsl: Fix error checking for platform_get_irq()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mark Brown authored and David S. Miller committed Nov 30, 2015
1 parent fea0f66 commit 0f2c0d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/gianfar_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0f2c0d3

Please sign in to comment.