提交 977bc20c 编写于 作者: D Dan Carpenter 提交者: David S. Miller

mediatek: checking for IS_ERR() instead of NULL

of_phy_connect() returns NULL on error, it never returns error pointers.

Fixes: 656e7052 ('net-next: mediatek: add support for MT7623 ethernet')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NJohn Crispin <blogic@openwrt.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fe3a5f6c
......@@ -186,9 +186,9 @@ static int mtk_phy_connect_node(struct mtk_eth *eth, struct mtk_mac *mac,
phydev = of_phy_connect(eth->netdev[mac->id], phy_node,
mtk_phy_link_adjust, 0, phy_mode);
if (IS_ERR(phydev)) {
if (!phydev) {
dev_err(eth->dev, "could not connect to PHY\n");
return PTR_ERR(phydev);
return -ENODEV;
}
dev_info(eth->dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册