Skip to content

Commit 9d350d8

Browse files
Wei Yongjungregkh
authored andcommitted
staging: mt7621-eth: fix return value check in mtk_connect_phy_node()
In case of error, the function of_phy_connect() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: e3cbf47 ("staging: mt7621-eth: add the drivers core files") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 960526d commit 9d350d8

File tree

1 file changed

+2
-2
lines changed
  • drivers/staging/mt7621-eth

1 file changed

+2
-2
lines changed

drivers/staging/mt7621-eth/mdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ int mtk_connect_phy_node(struct mtk_eth *eth, struct mtk_mac *mac,
8282

8383
phydev = of_phy_connect(eth->netdev[mac->id], phy_node,
8484
mtk_phy_link_adjust, 0, phy_mode);
85-
if (IS_ERR(phydev)) {
85+
if (!phydev) {
8686
dev_err(eth->dev, "could not connect to PHY\n");
8787
eth->phy->phy_node[port] = NULL;
88-
return PTR_ERR(phydev);
88+
return -ENODEV;
8989
}
9090

9191
phydev->supported &= PHY_GBIT_FEATURES;

0 commit comments

Comments
 (0)