Commit a77e4acc authored by Pavel Machek's avatar Pavel Machek Committed by David S. Miller

stmmac: simple cleanups

This adds simple cleanups for stmmac, removing test we know is always
true, fixing whitespace, and moving code out of if().
Signed-off-by: default avatarPavel Machek <pavel@denx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b209af99
...@@ -261,11 +261,11 @@ static int stmmac_ethtool_getsettings(struct net_device *dev, ...@@ -261,11 +261,11 @@ static int stmmac_ethtool_getsettings(struct net_device *dev,
ethtool_cmd_speed_set(cmd, priv->xstats.pcs_speed); ethtool_cmd_speed_set(cmd, priv->xstats.pcs_speed);
/* Get and convert ADV/LP_ADV from the HW AN registers */ /* Get and convert ADV/LP_ADV from the HW AN registers */
if (priv->hw->mac->get_adv) if (!priv->hw->mac->get_adv)
priv->hw->mac->get_adv(priv->hw, &adv);
else
return -EOPNOTSUPP; /* should never happen indeed */ return -EOPNOTSUPP; /* should never happen indeed */
priv->hw->mac->get_adv(priv->hw, &adv);
/* Encoding of PSE bits is defined in 802.3z, 37.2.1.4 */ /* Encoding of PSE bits is defined in 802.3z, 37.2.1.4 */
if (adv.pause & STMMAC_PCS_PAUSE) if (adv.pause & STMMAC_PCS_PAUSE)
...@@ -340,19 +340,17 @@ static int stmmac_ethtool_setsettings(struct net_device *dev, ...@@ -340,19 +340,17 @@ static int stmmac_ethtool_setsettings(struct net_device *dev,
if (cmd->autoneg != AUTONEG_ENABLE) if (cmd->autoneg != AUTONEG_ENABLE)
return -EINVAL; return -EINVAL;
if (cmd->autoneg == AUTONEG_ENABLE) { mask &= (ADVERTISED_1000baseT_Half |
mask &= (ADVERTISED_1000baseT_Half |
ADVERTISED_1000baseT_Full | ADVERTISED_1000baseT_Full |
ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Half |
ADVERTISED_100baseT_Full | ADVERTISED_100baseT_Full |
ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Half |
ADVERTISED_10baseT_Full); ADVERTISED_10baseT_Full);
spin_lock(&priv->lock); spin_lock(&priv->lock);
if (priv->hw->mac->ctrl_ane) if (priv->hw->mac->ctrl_ane)
priv->hw->mac->ctrl_ane(priv->hw, 1); priv->hw->mac->ctrl_ane(priv->hw, 1);
spin_unlock(&priv->lock); spin_unlock(&priv->lock);
}
return 0; return 0;
} }
......
...@@ -818,7 +818,7 @@ static int stmmac_init_phy(struct net_device *dev) ...@@ -818,7 +818,7 @@ static int stmmac_init_phy(struct net_device *dev)
/* Stop Advertising 1000BASE Capability if interface is not GMII */ /* Stop Advertising 1000BASE Capability if interface is not GMII */
if ((interface == PHY_INTERFACE_MODE_MII) || if ((interface == PHY_INTERFACE_MODE_MII) ||
(interface == PHY_INTERFACE_MODE_RMII) || (interface == PHY_INTERFACE_MODE_RMII) ||
(max_speed < 1000 && max_speed > 0)) (max_speed < 1000 && max_speed > 0))
phydev->advertising &= ~(SUPPORTED_1000baseT_Half | phydev->advertising &= ~(SUPPORTED_1000baseT_Half |
SUPPORTED_1000baseT_Full); SUPPORTED_1000baseT_Full);
......
...@@ -253,7 +253,7 @@ int stmmac_mdio_register(struct net_device *ndev) ...@@ -253,7 +253,7 @@ int stmmac_mdio_register(struct net_device *ndev)
} }
/* /*
* If we're going to bind the MAC to this PHY bus, * If we're going to bind the MAC to this PHY bus,
* and no PHY number was provided to the MAC, * and no PHY number was provided to the MAC,
* use the one probed here. * use the one probed here.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment