提交 ce24c2b8 编写于 作者: S Sergei Shtylyov 提交者: David S. Miller

macb: fix mdiobus_scan() error check

Now mdiobus_scan() returns ERR_PTR(-ENODEV) instead of NULL if the PHY
device ID was read as all ones. As this was not  an error before, this
value  should be filtered out now in this driver.

Fixes: b74766a0 ("phylib: don't return NULL from get_phy_device()")
Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6dd74542
......@@ -458,7 +458,8 @@ static int macb_mii_init(struct macb *bp)
struct phy_device *phydev;
phydev = mdiobus_scan(bp->mii_bus, i);
if (IS_ERR(phydev)) {
if (IS_ERR(phydev) &&
PTR_ERR(phydev) != -ENODEV) {
err = PTR_ERR(phydev);
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册