]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net: fec: remove useless fep->opened
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 7 Jul 2014 23:23:09 +0000 (00:23 +0100)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:17:39 +0000 (21:17 -0600)
napi_disable() waits until the NAPI processing has completed, and then
prevents any further polls.  At this point, the driver then clears
fep->opened.  The NAPI poll function uses this to stop processing in
the receive path.  Hence, it will never see this variable cleared,
because the NAPI poll has to complete before it will be cleared.

Therefore, this variable serves no purpose, so let's remove it.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c

index 671d080105a7e08c5e20456a5ad38b29f6704e19..96d2a18f1b999cf419b997c343ed163abb510242 100644 (file)
@@ -308,7 +308,6 @@ struct fec_enet_private {
 
        struct  platform_device *pdev;
 
-       int     opened;
        int     dev_id;
 
        /* Phylib and MDIO interface */
index e0a1ac1826b73921f6519a048d9187954c2e5439..309aa2ff8cc90e16d7a7a98baba0763ad8b8d307 100644 (file)
@@ -1215,9 +1215,6 @@ fec_enet_rx(struct net_device *ndev, int budget)
                if ((status & BD_ENET_RX_LAST) == 0)
                        netdev_err(ndev, "rcv is not +last\n");
 
-               if (!fep->opened)
-                       goto rx_processing_done;
-
                /* Check for errors. */
                if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
                           BD_ENET_RX_CR | BD_ENET_RX_OV)) {
@@ -2172,7 +2169,6 @@ fec_enet_open(struct net_device *ndev)
        napi_enable(&fep->napi);
        phy_start(fep->phy_dev);
        netif_start_queue(ndev);
-       fep->opened = 1;
        return 0;
 }
 
@@ -2185,7 +2181,6 @@ fec_enet_close(struct net_device *ndev)
 
        /* Don't know what to do yet. */
        napi_disable(&fep->napi);
-       fep->opened = 0;
        netif_tx_disable(ndev);
        fec_stop(ndev);