Skip to contentSkip to conversation

net: axienet: Fix error return code in axienet_probe()

PATCH In review Wei Yongjun 3 participants 4 messages Nov 6, 2019 – Nov 7, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

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.

Fixes 28ef9ebdb64c ("net: axienet: make use of axistream-connected attribute optional")
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0 -4
index 867726d696e2..8f32db6d2c45 100644
@@ -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);
Reviewed-by on v1 1/1
#1 lore raw
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 in axienet_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 attribute

optional")

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
index 867726d696e2..8f32db6d2c45 100644
@@ -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 -0
 		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);
maintainer
#2 lore raw
In reply to Wei Yongjun

From: 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")

Fixed with the commit message typo fixed.

maintainer
#3 lore raw

From: 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 +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")

Fixed with the commit message typo fixed.

I meant "Applied with the commit message typo fixed." :-)