Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df555b66 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller
Browse files

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc9259a8
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -722,10 +722,8 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
				   octeon_mgmt_adjust_link, 0,
				   octeon_mgmt_adjust_link, 0,
				   PHY_INTERFACE_MODE_MII);
				   PHY_INTERFACE_MODE_MII);


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


	phy_start_aneg(p->phydev);
	phy_start_aneg(p->phydev);