lkml.org 
[lkml]   [2021]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 20/20] net: stmmac: Move MAC Tx/Rx disabling to HW-setup antagonist
Date
Since MAC Tx/Rx activity is enabled in the core hardware setup procedure
it would be logically correct to it disabled in the HW-setup antagonist -
stmmac_hw_teardown(). Let's do that to improve the driver code coherency
and thus readability.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 3c03b773295a..f70cab9f46d9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2795,6 +2795,8 @@ static void stmmac_hw_teardown(struct net_device *dev)
stmmac_stop_all_dma(priv);

stmmac_release_ptp(priv);
+
+ stmmac_mac_set(priv, priv->ioaddr, false);
}

/**
@@ -2978,9 +2980,6 @@ static int stmmac_release(struct net_device *dev)
/* Release and free the Rx/Tx resources */
free_dma_desc_resources(priv);

- /* Disable the MAC Rx/Tx */
- stmmac_mac_set(priv, priv->ioaddr, false);
-
netif_carrier_off(dev);

return 0;
--
2.29.2
\
 
 \ /
  Last update: 2021-02-08 15:31    [W:0.305 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site