net: axienet: Fix error return code in axienet_probe()
Subsystems (5)
PATCH 1/1 net: axienet: Fix error return code in axienet_probe()
In the DMA memory resource get failed case, the error is not set and 0 will be returned. Fix it by reove redundant check since devm_ioremap_resource() will handle it.
--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0 -4
@@ -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 );
Quoted 10 lines
-----Original Message-----
From: Wei Yongjun <[email protected]>
Sent: Wednesday, November 6, 2019 9:25 PM
To: Radhey Shyam Pandey <[email protected]>; Michal Simek <[email protected]>; Russell King <[email protected]>; Robert Hancock <[email protected]>
Cc: Wei Yongjun <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH net-next] net: axienet: Fix error return code inaxienet_probe()
Quoted 2 lines
In the DMA memory resource get failed case, the error is not set and 0 will be returned. Fix it by reove redundant check
:s/reove/removing
Quoted 5 lines
since
devm_ioremap_resource()will handle it.Fixes 28ef9ebdb64c ("net: axienet: make use of axistream-connected attributeoptional")
Signed-off-by Wei Yongjun <[email protected]>
The rest looks fine.
Quoted 25 lines
--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ---- 1 file changed, 4 deletions(-)drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0
-4@@ -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; - }drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0
-0lp->dma_regs =devm_ioremap_resource (&pdev->dev, res); lp->rx_irq =platform_get_irq (pdev,1 ); lp->tx_irq =platform_get_irq (pdev,0 );
David Miller
maintainerFrom: Wei Yongjun <[email protected]>
Date: Wed, 6 Nov 2019 15:54:49 +0000
Quoted 6 lines
In the DMA memory resource get failed case, the error is not set and 0 will be returned. Fix it by reove 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 <[email protected]>
Fixed with the commit message typo fixed.
David Miller
maintainerFrom: David Miller <[email protected]>
Date: Wed, 06 Nov 2019 21:24:41 -0800 (PST)
Quoted 11 lines
From: Wei Yongjun <[email protected]>
Date: Wed, 6 Nov 2019 15:54:49 +0000Quoted 6 lines
In the DMA memory resource get failed case, the error is not set and 0 will be returned. Fix it by reove 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 <[email protected]>Fixed with the commit message typo fixed.
I meant "Applied with the commit message typo fixed." :-)