Skip to content

Commit 277780b

Browse files
author
Vince Bridgers
committed
FogBugz #189737: Check phy connect return codes when initializing phy
The phy initialization code should check the results of of_phy_connect and connect_local_phy in the init_phy routine. This was caught during community review. Signed-off-by: Vince Bridgers <[email protected]>
1 parent ab3b361 commit 277780b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/altera/altera_tse_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,10 @@ static int init_phy(struct net_device *dev)
761761
&altera_tse_adjust_link, 0, priv->phy_iface);
762762
}
763763

764+
if (!phydev) {
765+
netdev_err(dev, "Could not find the PHY\n");
766+
return -ENODEV;
767+
}
764768
/* Stop Advertising 1000BASE Capability if interface is not GMII
765769
* Note: Checkpatch throws CHECKs for the camel case defines below,
766770
* it's ok to ignore.

0 commit comments

Comments
 (0)