Skip to content

Commit f12e76c

Browse files
committed
lan78xx: Return tx_lpi_timer even if disabled
Disabling tx_lpi or eee should not cause the value of tx_lpi_timer to be lost, even though it is not useful until they are re-enabled. Signed-off-by: Phil Elwell <[email protected]>
1 parent abb2730 commit f12e76c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/net/usb/lan78xx.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,14 +1707,11 @@ static int lan78xx_get_eee(struct net_device *net, struct ethtool_keee *edata)
17071707
if (ret < 0)
17081708
goto exit;
17091709

1710-
ret = lan78xx_read_reg(dev, MAC_CR, &buf);
1711-
if (buf & MAC_CR_EEE_EN_) {
1712-
/* EEE_TX_LPI_REQ_DLY & tx_lpi_timer are same uSec unit */
1713-
ret = lan78xx_read_reg(dev, EEE_TX_LPI_REQ_DLY, &buf);
1710+
ret = lan78xx_read_reg(dev, EEE_TX_LPI_REQ_DLY, &buf);
1711+
if (ret >= 0)
17141712
edata->tx_lpi_timer = buf;
1715-
} else {
1713+
else
17161714
edata->tx_lpi_timer = 0;
1717-
}
17181715

17191716
ret = 0;
17201717
exit:

0 commit comments

Comments
 (0)