Commit 39198ec9 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by David S. Miller

net: lpc_eth: remove irq > NR_IRQS check from probe()

If the driver is used on an ARM platform with SPARSE_IRQ defined,
semantics of NR_IRQS is different (minimal value of virtual irqs) and
by default it is set to 16, see arch/arm/include/asm/irq.h.

This value may be less than the actual number of virtual irqs, which
may break the driver initialization. The check removal allows to use
the driver on such a platform, and, if irq controller driver works
correctly, the check is not needed on legacy platforms.

Fixes a runtime problem:

    lpc-eth 31060000.ethernet: error getting resources.
    lpc_eth: lpc-eth: not found (-6).
Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4eaf3b84
...@@ -1326,7 +1326,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) ...@@ -1326,7 +1326,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
/* Get platform resources */ /* Get platform resources */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if ((!res) || (irq < 0) || (irq >= NR_IRQS)) { if (!res || irq < 0) {
dev_err(&pdev->dev, "error getting resources.\n"); dev_err(&pdev->dev, "error getting resources.\n");
ret = -ENXIO; ret = -ENXIO;
goto err_exit; goto err_exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment