Skip to content

Commit

Permalink
netdev: octeon: fix return value check in octeon_mgmt_init_phy()
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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and davem330 committed Sep 28, 2012
1 parent bc9259a commit df555b6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/octeon/octeon_mgmt.c
Expand Up @@ -722,10 +722,8 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
octeon_mgmt_adjust_link, 0,
PHY_INTERFACE_MODE_MII);

if (IS_ERR(p->phydev)) {
p->phydev = NULL;
if (!p->phydev)
return -1;
}

phy_start_aneg(p->phydev);

Expand Down

0 comments on commit df555b6

Please sign in to comment.