net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open()

The phy_connect() function doesn't return NULL pointers.  It returns
error pointers on error, so I have updated the check.

Fixes: 8425c41d1e ("net: ll_temac: Extend support to non-device-tree platforms")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dan Carpenter 2019-05-03 15:50:24 +03:00 committed by David S. Miller
parent fdd1a8103a
commit 1ffc4b7c58
1 changed files with 2 additions and 2 deletions

View File

@ -927,9 +927,9 @@ static int temac_open(struct net_device *ndev)
} else if (strlen(lp->phy_name) > 0) {
phydev = phy_connect(lp->ndev, lp->phy_name, temac_adjust_link,
lp->phy_interface);
if (!phydev) {
if (IS_ERR(phydev)) {
dev_err(lp->dev, "phy_connect() failed\n");
return -ENODEV;
return PTR_ERR(phydev);
}
phy_start(phydev);
}