sh_eth: remove open coded netif_running()
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 21 Mar 2023 06:58:26 +0000 (07:58 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 22 Mar 2023 12:23:57 +0000 (13:23 +0100)
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>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20230321065826.2044-1-wsa+renesas@sang-engineering.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/renesas/sh_eth.c
drivers/net/ethernet/renesas/sh_eth.h

index d8ec729825be44fe5735eb0333100ef0eebab260..2d97872310990fdbfb8bb528566450364cfd582e 100644 (file)
@@ -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;
index a5c07c6ff44a2318f9a4b0ebab2541e4f9227984..f56dbc8a064a247866683f7df3d55b2ed2afa0dd 100644 (file)
@@ -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;
 };