提交 9c6464dc 编写于 作者: D Dejin Zheng 提交者: David S. Miller

net: phy: aquantia: use phy_read_mmd_poll_timeout() to simplify the code

use phy_read_mmd_poll_timeout() to replace the poll codes for
simplify aqr107_wait_reset_complete() function.
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 331c7372
......@@ -434,16 +434,11 @@ static int aqr107_set_tunable(struct phy_device *phydev,
*/
static int aqr107_wait_reset_complete(struct phy_device *phydev)
{
int val, retries = 100;
do {
val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID);
if (val < 0)
return val;
msleep(20);
} while (!val && --retries);
int val;
return val ? 0 : -ETIMEDOUT;
return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
VEND1_GLOBAL_FW_ID, val, val != 0,
20000, 2000000, false);
}
static void aqr107_chip_info(struct phy_device *phydev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册