summaryrefslogtreecommitdiff
path: root/drivers/staging/octeon/ethernet.c
diff options
context:
space:
mode:
authorPhilippe Reynes <tremyfr@gmail.com>2016-07-16 01:13:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-21 18:02:32 +0200
commit5d99db13b77e301fcd839310d47392053db35562 (patch)
treee937dc658aca495243b7835ed62624198d6ef7fc /drivers/staging/octeon/ethernet.c
parent0048a44c36db045071dcb1bb4844140cd3712e1d (diff)
net: ethernet: octeon: use phydev from struct net_device
The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/octeon/ethernet.c')
-rw-r--r--drivers/staging/octeon/ethernet.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 48f2adbfd2b8..2eb97317f631 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -457,10 +457,8 @@ int cvm_oct_common_init(struct net_device *dev)
void cvm_oct_common_uninit(struct net_device *dev)
{
- struct octeon_ethernet *priv = netdev_priv(dev);
-
- if (priv->phydev)
- phy_disconnect(priv->phydev);
+ if (dev->phydev)
+ phy_disconnect(dev->phydev);
}
int cvm_oct_common_open(struct net_device *dev,
@@ -484,10 +482,10 @@ int cvm_oct_common_open(struct net_device *dev,
if (octeon_is_simulation())
return 0;
- if (priv->phydev) {
- int r = phy_read_status(priv->phydev);
+ if (dev->phydev) {
+ int r = phy_read_status(dev->phydev);
- if (r == 0 && priv->phydev->link == 0)
+ if (r == 0 && dev->phydev->link == 0)
netif_carrier_off(dev);
cvm_oct_adjust_link(dev);
} else {