From be76400c31194d759b621bc2b70f0c61882fbaec Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Sat, 4 Apr 2015 22:51:04 +0300 Subject: [PATCH] staging: octeon-ethernet: move ndo_stop to common init All init functions call ndo_stop if it's defined, so move it to common function. Signed-off-by: Aaro Koskinen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/octeon/ethernet-rgmii.c | 1 - drivers/staging/octeon/ethernet-sgmii.c | 1 - drivers/staging/octeon/ethernet-xaui.c | 1 - drivers/staging/octeon/ethernet.c | 3 +++ 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/octeon/ethernet-rgmii.c b/drivers/staging/octeon/ethernet-rgmii.c index c428a452ddbe..a6b853118bc5 100644 --- a/drivers/staging/octeon/ethernet-rgmii.c +++ b/drivers/staging/octeon/ethernet-rgmii.c @@ -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 diff --git a/drivers/staging/octeon/ethernet-sgmii.c b/drivers/staging/octeon/ethernet-sgmii.c index ece2880b9910..cd791c362273 100644 --- a/drivers/staging/octeon/ethernet-sgmii.c +++ b/drivers/staging/octeon/ethernet-sgmii.c @@ -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; diff --git a/drivers/staging/octeon/ethernet-xaui.c b/drivers/staging/octeon/ethernet-xaui.c index e8e51ed779d5..5782c38a9c9c 100644 --- a/drivers/staging/octeon/ethernet-xaui.c +++ b/drivers/staging/octeon/ethernet-xaui.c @@ -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; diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c index 2a3f9e2acbaa..fdd23bfa62d1 100644 --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c @@ -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; } -- 2.20.1