staging: octeon-ethernet: move ndo_stop to common init
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sat, 4 Apr 2015 19:51:04 +0000 (22:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 14:59:23 +0000 (16:59 +0200)
All init functions call ndo_stop if it's defined, so move it
to common function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/octeon/ethernet-rgmii.c
drivers/staging/octeon/ethernet-sgmii.c
drivers/staging/octeon/ethernet-xaui.c
drivers/staging/octeon/ethernet.c

index c428a452ddbe5ded0a879ed1b7768a89fda829f6..a6b853118bc53d5ba49e4879f60bac9c0837e4bc 100644 (file)
@@ -314,7 +314,6 @@ int cvm_oct_rgmii_init(struct net_device *dev)
        int r;
 
        cvm_oct_common_init(dev);
-       dev->netdev_ops->ndo_stop(dev);
        INIT_WORK(&priv->port_work, cvm_oct_rgmii_immediate_poll);
        /*
         * Due to GMX errata in CN3XXX series chips, it is necessary
index ece2880b991080549c27341995c8c75ad7c5ba6c..cd791c36227325d4f8446717857f288fe87f3d93 100644 (file)
@@ -85,7 +85,6 @@ int cvm_oct_sgmii_open(struct net_device *dev)
 int cvm_oct_sgmii_init(struct net_device *dev)
 {
        cvm_oct_common_init(dev);
-       dev->netdev_ops->ndo_stop(dev);
 
        /* FIXME: Need autoneg logic */
        return 0;
index e8e51ed779d58f60b0263146d7abdbded3c1b18f..5782c38a9c9cadd440634c57b8a49acd4f6d8e48 100644 (file)
@@ -87,7 +87,6 @@ int cvm_oct_xaui_init(struct net_device *dev)
        struct octeon_ethernet *priv = netdev_priv(dev);
 
        cvm_oct_common_init(dev);
-       dev->netdev_ops->ndo_stop(dev);
        if (!octeon_is_simulation() && priv->phydev == NULL)
                priv->poll = cvm_oct_xaui_poll;
 
index 2a3f9e2acbaa11f00dd4150f72ffeff42f2e14ff..fdd23bfa62d1cdece20b973109dc2f08311761b5 100644 (file)
@@ -488,6 +488,9 @@ int cvm_oct_common_init(struct net_device *dev)
        memset(dev->netdev_ops->ndo_get_stats(dev), 0,
               sizeof(struct net_device_stats));
 
+       if (dev->netdev_ops->ndo_stop)
+               dev->netdev_ops->ndo_stop(dev);
+
        return 0;
 }