summaryrefslogtreecommitdiff
path: root/drivers/staging/octeon/ethernet-sgmii.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2015-04-04 22:51:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-30 16:59:24 +0200
commita8d2e8171082854dadea64b808af4b54f78c0384 (patch)
tree953355b1057fc7335ba1808e032eb09a307b3985 /drivers/staging/octeon/ethernet-sgmii.c
parent2638f71307f649532f613a4bcb3b163b7b63017a (diff)
staging: octeon-ethernet: sgmii/xaui: make link poll generic
Make link poll generic to avoid copy paste. 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-sgmii.c')
-rw-r--r--drivers/staging/octeon/ethernet-sgmii.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/staging/octeon/ethernet-sgmii.c b/drivers/staging/octeon/ethernet-sgmii.c
index 9a747f94d48c..1940f4b72a66 100644
--- a/drivers/staging/octeon/ethernet-sgmii.c
+++ b/drivers/staging/octeon/ethernet-sgmii.c
@@ -41,31 +41,9 @@
#include <asm/octeon/cvmx-gmxx-defs.h>
-static void cvm_oct_sgmii_poll(struct net_device *dev)
-{
- struct octeon_ethernet *priv = netdev_priv(dev);
- cvmx_helper_link_info_t link_info;
-
- link_info = cvmx_helper_link_get(priv->port);
- if (link_info.u64 == priv->link_info)
- return;
-
- link_info = cvmx_helper_link_autoconf(priv->port);
- priv->link_info = link_info.u64;
-
- /* Tell Linux */
- if (link_info.s.link_up) {
- if (!netif_carrier_ok(dev))
- netif_carrier_on(dev);
- } else if (netif_carrier_ok(dev)) {
- netif_carrier_off(dev);
- }
- cvm_oct_note_carrier(priv, link_info);
-}
-
int cvm_oct_sgmii_open(struct net_device *dev)
{
- return cvm_oct_common_open(dev, cvm_oct_sgmii_poll, true);
+ return cvm_oct_common_open(dev, cvm_oct_link_poll, true);
}
int cvm_oct_sgmii_init(struct net_device *dev)