diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2015-04-04 22:51:02 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-30 17:59:23 +0300 |
commit | 9e3ae4f9aecffcc376a714d5088a1275054f9dbf (patch) | |
tree | d9c5702e0708f64704999f5d2e8bf3726f62a122 /drivers/staging/octeon/ethernet-rgmii.c | |
parent | 32b249b0f54fb304c5f90be00ebcb9c1a32d415c (diff) | |
download | linux-9e3ae4f9aecffcc376a714d5088a1275054f9dbf.tar.xz |
staging: octeon-ethernet: consolidate ndo_open functions
ndo_open for rgmii, sgmii and xaui are almost identical. Put the common
code in a single function.
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-rgmii.c')
-rw-r--r-- | drivers/staging/octeon/ethernet-rgmii.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/drivers/staging/octeon/ethernet-rgmii.c b/drivers/staging/octeon/ethernet-rgmii.c index e36f9bc69543..88889d30cc03 100644 --- a/drivers/staging/octeon/ethernet-rgmii.c +++ b/drivers/staging/octeon/ethernet-rgmii.c @@ -298,37 +298,7 @@ static irqreturn_t cvm_oct_rgmii_rml_interrupt(int cpl, void *dev_id) int cvm_oct_rgmii_open(struct net_device *dev) { - union cvmx_gmxx_prtx_cfg gmx_cfg; - struct octeon_ethernet *priv = netdev_priv(dev); - int interface = INTERFACE(priv->port); - int index = INDEX(priv->port); - cvmx_helper_link_info_t link_info; - int rv; - - rv = cvm_oct_phy_setup_device(dev); - if (rv) - return rv; - - gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); - gmx_cfg.s.en = 1; - cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - - if (!octeon_is_simulation()) { - if (priv->phydev) { - int r = phy_read_status(priv->phydev); - - if (r == 0 && priv->phydev->link == 0) - netif_carrier_off(dev); - cvm_oct_adjust_link(dev); - } else { - link_info = cvmx_helper_link_get(priv->port); - if (!link_info.s.link_up) - netif_carrier_off(dev); - priv->poll = cvm_oct_rgmii_poll; - } - } - - return 0; + return cvm_oct_common_open(dev, cvm_oct_rgmii_poll, false); } int cvm_oct_rgmii_stop(struct net_device *dev) |