net: axienet: Fix error return code in axienet_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 6 Nov 2019 15:54:49 +0000 (15:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Nov 2019 05:24:16 +0000 (21:24 -0800)
In the DMA memory resource get failed case, the error is not
set and 0 will be returned. Fix it by removing redundant check
since devm_ioremap_resource() will handle it.

Fixes: 28ef9ebdb64c ("net: axienet: make use of axistream-connected attribute optional")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index 867726d696e2ddea0e32b8c8b5411993491818e0..8f32db6d2c454614c8b7193c8d9f15f5901152bb 100644 (file)
@@ -1788,10 +1788,6 @@ static int axienet_probe(struct platform_device *pdev)
                /* Check for these resources directly on the Ethernet node. */
                struct resource *res = platform_get_resource(pdev,
                                                             IORESOURCE_MEM, 1);
-               if (!res) {
-                       dev_err(&pdev->dev, "unable to get DMA memory resource\n");
-                       goto free_netdev;
-               }
                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);