diff options
-rw-r--r-- | drivers/net/greth.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index 9386bce9dea5..e48d18216cbe 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c | |||
@@ -1232,29 +1232,26 @@ static void greth_link_change(struct net_device *dev) | |||
1232 | struct greth_private *greth = netdev_priv(dev); | 1232 | struct greth_private *greth = netdev_priv(dev); |
1233 | struct phy_device *phydev = greth->phy; | 1233 | struct phy_device *phydev = greth->phy; |
1234 | unsigned long flags; | 1234 | unsigned long flags; |
1235 | |||
1236 | int status_change = 0; | 1235 | int status_change = 0; |
1236 | u32 ctrl; | ||
1237 | 1237 | ||
1238 | spin_lock_irqsave(&greth->devlock, flags); | 1238 | spin_lock_irqsave(&greth->devlock, flags); |
1239 | 1239 | ||
1240 | if (phydev->link) { | 1240 | if (phydev->link) { |
1241 | 1241 | ||
1242 | if ((greth->speed != phydev->speed) || (greth->duplex != phydev->duplex)) { | 1242 | if ((greth->speed != phydev->speed) || (greth->duplex != phydev->duplex)) { |
1243 | 1243 | ctrl = GRETH_REGLOAD(greth->regs->control) & | |
1244 | GRETH_REGANDIN(greth->regs->control, | 1244 | ~(GRETH_CTRL_FD | GRETH_CTRL_SP | GRETH_CTRL_GB); |
1245 | ~(GRETH_CTRL_FD | GRETH_CTRL_SP | GRETH_CTRL_GB)); | ||
1246 | 1245 | ||
1247 | if (phydev->duplex) | 1246 | if (phydev->duplex) |
1248 | GRETH_REGORIN(greth->regs->control, GRETH_CTRL_FD); | 1247 | ctrl |= GRETH_CTRL_FD; |
1249 | |||
1250 | if (phydev->speed == SPEED_100) { | ||
1251 | |||
1252 | GRETH_REGORIN(greth->regs->control, GRETH_CTRL_SP); | ||
1253 | } | ||
1254 | 1248 | ||
1249 | if (phydev->speed == SPEED_100) | ||
1250 | ctrl |= GRETH_CTRL_SP; | ||
1255 | else if (phydev->speed == SPEED_1000) | 1251 | else if (phydev->speed == SPEED_1000) |
1256 | GRETH_REGORIN(greth->regs->control, GRETH_CTRL_GB); | 1252 | ctrl |= GRETH_CTRL_GB; |
1257 | 1253 | ||
1254 | GRETH_REGSAVE(greth->regs->control, ctrl); | ||
1258 | greth->speed = phydev->speed; | 1255 | greth->speed = phydev->speed; |
1259 | greth->duplex = phydev->duplex; | 1256 | greth->duplex = phydev->duplex; |
1260 | status_change = 1; | 1257 | status_change = 1; |