Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: phy: marvell: Use phy_read_paged() instead of open coding it

Convert m88e1318_get_wol() to use the well implemented phy_read_paged()
instead of open coding it.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jisheng Zhang and committed by
David S. Miller
f4f9dcc3 2e554a7a

+4 -10
+4 -10
drivers/net/phy/marvell.c
··· 1598 1598 static void m88e1318_get_wol(struct phy_device *phydev, 1599 1599 struct ethtool_wolinfo *wol) 1600 1600 { 1601 - int oldpage, ret = 0; 1601 + int ret; 1602 1602 1603 1603 wol->supported = WAKE_MAGIC; 1604 1604 wol->wolopts = 0; 1605 1605 1606 - oldpage = phy_select_page(phydev, MII_MARVELL_WOL_PAGE); 1607 - if (oldpage < 0) 1608 - goto error; 1609 - 1610 - ret = __phy_read(phydev, MII_88E1318S_PHY_WOL_CTRL); 1611 - if (ret & MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE) 1606 + ret = phy_read_paged(phydev, MII_MARVELL_WOL_PAGE, 1607 + MII_88E1318S_PHY_WOL_CTRL); 1608 + if (ret >= 0 && ret & MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE) 1612 1609 wol->wolopts |= WAKE_MAGIC; 1613 - 1614 - error: 1615 - phy_restore_page(phydev, oldpage, ret); 1616 1610 } 1617 1611 1618 1612 static int m88e1318_set_wol(struct phy_device *phydev,