aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-09-27 15:04:21 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-28 01:18:32 -0400
commitdf555b665367f9de6c04826acc482096f17c243d (patch)
treea7ddfe21f30e9b0f99da71425e9e6aeef430aa33 /drivers
parentbc9259a8bae9e814fc1f775a1b3effa13e6ad330 (diff)
netdev: octeon: fix return value check in octeon_mgmt_init_phy()
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/octeon/octeon_mgmt.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index c42bbb16cdae..a688a2ddcfd6 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -722,10 +722,8 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
722 octeon_mgmt_adjust_link, 0, 722 octeon_mgmt_adjust_link, 0,
723 PHY_INTERFACE_MODE_MII); 723 PHY_INTERFACE_MODE_MII);
724 724
725 if (IS_ERR(p->phydev)) { 725 if (!p->phydev)
726 p->phydev = NULL;
727 return -1; 726 return -1;
728 }
729 727
730 phy_start_aneg(p->phydev); 728 phy_start_aneg(p->phydev);
731 729