net: axienet: Mark eth_irq as optional
authorAndre Przywara <andre.przywara@arm.com>
Tue, 24 Mar 2020 13:23:41 +0000 (13:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2020 23:33:04 +0000 (16:33 -0700)
According to the DT binding, the Ethernet core interrupt is optional.

Use platform_get_irq_optional() to avoid the error message when the
IRQ is not specified.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index 736ac1b7a05274f3f73982d2bb1181752feb62f2..60c8cde365f843dc0d9dc995d82b6173341258d9 100644 (file)
@@ -1851,7 +1851,7 @@ static int axienet_probe(struct platform_device *pdev)
                lp->rx_irq = irq_of_parse_and_map(np, 1);
                lp->tx_irq = irq_of_parse_and_map(np, 0);
                of_node_put(np);
-               lp->eth_irq = platform_get_irq(pdev, 0);
+               lp->eth_irq = platform_get_irq_optional(pdev, 0);
        } else {
                /* Check for these resources directly on the Ethernet node. */
                struct resource *res = platform_get_resource(pdev,
@@ -1859,7 +1859,7 @@ static int axienet_probe(struct platform_device *pdev)
                lp->dma_regs = devm_ioremap_resource(&pdev->dev, res);
                lp->rx_irq = platform_get_irq(pdev, 1);
                lp->tx_irq = platform_get_irq(pdev, 0);
-               lp->eth_irq = platform_get_irq(pdev, 2);
+               lp->eth_irq = platform_get_irq_optional(pdev, 2);
        }
        if (IS_ERR(lp->dma_regs)) {
                dev_err(&pdev->dev, "could not map DMA regs\n");