[PATCH 3/4] net: designware: eqos: replace double accounting of interface up status

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Aug 8 23:24:21 PDT 2022


Network core already keeps track of whether ethernet interface is up, so
no need to replicate holding this state.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/net/designware_eqos.c     | 11 -----------
 drivers/net/designware_eqos.h     |  1 -
 drivers/net/designware_tegra186.c |  2 +-
 3 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
index 6b372e427492..79b997969755 100644
--- a/drivers/net/designware_eqos.c
+++ b/drivers/net/designware_eqos.c
@@ -623,10 +623,6 @@ static int eqos_start(struct eth_device *edev)
 	last_rx_desc = (ulong)&eqos->rx_descs[(EQOS_DESCRIPTORS_RX - 1)];
 	writel(last_rx_desc, &eqos->dma_regs->ch0_rxdesc_tail_pointer);
 
-	barrier();
-
-	eqos->started = true;
-
 	return 0;
 }
 
@@ -635,13 +631,6 @@ static void eqos_stop(struct eth_device *edev)
 	struct eqos *eqos = edev->priv;
 	int i;
 
-	if (!eqos->started)
-		return;
-
-	eqos->started = false;
-
-	barrier();
-
 	/* Disable TX DMA */
 	clrbits_le32(&eqos->dma_regs->ch0_tx_control,
 		     EQOS_DMA_CH0_TX_CONTROL_ST);
diff --git a/drivers/net/designware_eqos.h b/drivers/net/designware_eqos.h
index be7bead09e0e..69c6ac193f57 100644
--- a/drivers/net/designware_eqos.h
+++ b/drivers/net/designware_eqos.h
@@ -60,7 +60,6 @@ struct eqos {
 
 	const struct eqos_ops *ops;
 	void *priv;
-	bool started;
 };
 
 struct device_d;
diff --git a/drivers/net/designware_tegra186.c b/drivers/net/designware_tegra186.c
index 0241b9ad16ff..0cbbdb46a442 100644
--- a/drivers/net/designware_tegra186.c
+++ b/drivers/net/designware_tegra186.c
@@ -195,7 +195,7 @@ static int eqos_set_ethaddr_tegra186(struct eth_device *edev, const unsigned cha
 	 * ported to some system where the expectation above is true.
 	 */
 
-	if (!eqos->started) {
+	if (!edev->active) {
 		memcpy(eqos->macaddr, mac, 6);
 		return 0;
 	}
-- 
2.30.2




More information about the barebox mailing list