Skip to content

Commit beb5ac2

Browse files
Wei Yongjundavem330
authored andcommitted
netdev: pasemi: fix return value check in pasemi_mac_phy_init()
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. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a326e6d commit beb5ac2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/pasemi/pasemi_mac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,9 +1101,9 @@ static int pasemi_mac_phy_init(struct net_device *dev)
11011101
phydev = of_phy_connect(dev, phy_dn, &pasemi_adjust_link, 0,
11021102
PHY_INTERFACE_MODE_SGMII);
11031103

1104-
if (IS_ERR(phydev)) {
1104+
if (!phydev) {
11051105
printk(KERN_ERR "%s: Could not attach to phy\n", dev->name);
1106-
return PTR_ERR(phydev);
1106+
return -ENODEV;
11071107
}
11081108

11091109
mac->phydev = phydev;

0 commit comments

Comments
 (0)