Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
netdev: pasemi: fix return value check in pasemi_mac_phy_init()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Wei Yongjun authored and davem330 committed Sep 27, 2012
1 parent a326e6d commit beb5ac2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/pasemi/pasemi_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,9 +1101,9 @@ static int pasemi_mac_phy_init(struct net_device *dev)
phydev = of_phy_connect(dev, phy_dn, &pasemi_adjust_link, 0,
PHY_INTERFACE_MODE_SGMII);

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

mac->phydev = phydev;
Expand Down

0 comments on commit beb5ac2

Please sign in to comment.