All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] sh_eth: remove open coded netif_running()
@ 2023-03-21  6:58 Wolfram Sang
  2023-03-21  8:22 ` Leon Romanovsky
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Wolfram Sang @ 2023-03-21  6:58 UTC (permalink / raw)
  To: netdev
  Cc: linux-renesas-soc, Wolfram Sang, Geert Uytterhoeven,
	Sergey Shtylyov, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, linux-kernel

It had a purpose back in the days, but today we have a handy helper.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Based on 6.3-rc3 and tested on a Renesas Lager board (R-Car H2).

 drivers/net/ethernet/renesas/sh_eth.c | 6 +-----
 drivers/net/ethernet/renesas/sh_eth.h | 1 -
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index d8ec729825be..2d9787231099 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2441,8 +2441,6 @@ static int sh_eth_open(struct net_device *ndev)
 
 	netif_start_queue(ndev);
 
-	mdp->is_opened = 1;
-
 	return ret;
 
 out_free_irq:
@@ -2565,7 +2563,7 @@ static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev)
 	if (mdp->cd->no_tx_cntrs)
 		return &ndev->stats;
 
-	if (!mdp->is_opened)
+	if (!netif_running(ndev))
 		return &ndev->stats;
 
 	sh_eth_update_stat(ndev, &ndev->stats.tx_dropped, TROCR);
@@ -2614,8 +2612,6 @@ static int sh_eth_close(struct net_device *ndev)
 	/* Free all the skbuffs in the Rx queue and the DMA buffer. */
 	sh_eth_ring_free(ndev);
 
-	mdp->is_opened = 0;
-
 	pm_runtime_put(&mdp->pdev->dev);
 
 	return 0;
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index a5c07c6ff44a..f56dbc8a064a 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -560,7 +560,6 @@ struct sh_eth_private {
 
 	unsigned no_ether_link:1;
 	unsigned ether_link_active_low:1;
-	unsigned is_opened:1;
 	unsigned wol_enabled:1;
 };
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-03-27  8:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21  6:58 [PATCH net-next] sh_eth: remove open coded netif_running() Wolfram Sang
2023-03-21  8:22 ` Leon Romanovsky
2023-03-21 14:33 ` Geert Uytterhoeven
2023-03-21 16:58 ` Florian Fainelli
2023-03-22 12:30 ` patchwork-bot+netdevbpf
2023-03-22 20:57   ` Sergey Shtylyov
2023-03-22 20:54 ` Sergey Shtylyov
2023-03-23  8:32   ` Geert Uytterhoeven
2023-03-23 16:40     ` Jakub Kicinski
2023-03-25 20:27       ` Sergey Shtylyov
2023-03-27  8:14         ` Wolfram Sang
2023-03-25 20:56     ` Sergey Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.