summaryrefslogtreecommitdiff
path: root/drivers/staging/octeon/ethernet-mdio.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2015-04-04 22:51:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-30 16:59:23 +0200
commit96217ebff7f2fda012f755cdb28f34400fd5f99c (patch)
tree0004d83b15184840b4101254ad1be6b3c6021550 /drivers/staging/octeon/ethernet-mdio.c
parent9e3ae4f9aecffcc376a714d5088a1275054f9dbf (diff)
staging: octeon-ethernet: consolidate ndo_stop functions
All ndo_stop functions are identical. Get rid of duplicated code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/octeon/ethernet-mdio.c')
-rw-r--r--drivers/staging/octeon/ethernet-mdio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
index 40dab11e5333..ec38cb07eb7c 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -40,7 +40,7 @@
#include "ethernet-util.h"
#include <asm/octeon/cvmx-helper-board.h>
-
+#include <asm/octeon/cvmx-gmxx-defs.h>
#include <asm/octeon/cvmx-smix-defs.h>
static void cvm_oct_get_drvinfo(struct net_device *dev,
@@ -150,7 +150,14 @@ void cvm_oct_adjust_link(struct net_device *dev)
int cvm_oct_common_stop(struct net_device *dev)
{
struct octeon_ethernet *priv = netdev_priv(dev);
+ int interface = INTERFACE(priv->port);
cvmx_helper_link_info_t link_info;
+ union cvmx_gmxx_prtx_cfg gmx_cfg;
+ int index = INDEX(priv->port);
+
+ gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface));
+ gmx_cfg.s.en = 0;
+ cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64);
priv->poll = NULL;