Skip to contentSkip to conversation

net: stmmac: dwmac_lib: remove unnecessary checks in dwmac_dma_reset()

PATCH Applied Dejin Zheng 2 participants 2 messages Mar 19, 2020 – Mar 20, 2020

Subsystems (4)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: dwmac_lib: remove unnecessary checks in dwmac_dma_reset()

it will check the return value of dwmac_dma_reset() in the stmmac_init_dma_engine() function and report an error if the return value is not zero. so don't need check here.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c +1 -6
index 688d36095333..cb87d31a99df 100644
@@ -16,19 +16,14 @@
 int dwmac_dma_reset(void __iomem *ioaddr)
 {
 	u32 value = readl(ioaddr + DMA_BUS_MODE);
-	int err;
 
 	/* DMA SW reset */
 	value |= DMA_BUS_MODE_SFT_RESET;
 	writel(value, ioaddr + DMA_BUS_MODE);
 
-	err = readl_poll_timeout(ioaddr + DMA_BUS_MODE, value,
+	return readl_poll_timeout(ioaddr + DMA_BUS_MODE, value,
 				 !(value & DMA_BUS_MODE_SFT_RESET),
 				 10000, 100000);
-	if (err)
-		return -EBUSY;
-
-	return 0;
 }
 
 /* CSR1 enables the transmit DMA to check for new descriptor */
Signature · 1 line
2.25.0
maintainer Applied
#1 lore raw

From: Dejin Zheng <[email protected]>
Date: Thu, 19 Mar 2020 21:10:19 +0800

Quoted 5 lines

it will check the return value of dwmac_dma_reset() in the stmmac_init_dma_engine() function and report an error if the return value is not zero. so don't need check here.

Applied, thanks.