quoted hunk ↗ jump to hunk
@@ -1520,17 +1513,22 @@ static int smsc911x_open(struct net_device *dev)
unsigned int timeout;
unsigned int temp;
unsigned int intcfg;
+ int retval;
- /* if the phy is not yet registered, retry later*/
+ /* find and start the given phy */
if (!dev->phydev) {
- SMSC_WARN(pdata, hw, "phy_dev is NULL");
- return -EAGAIN;
+ if (smsc911x_mii_probe(dev) < 0) {
+ SMSC_WARN(pdata, probe, "Error starting phy");
+ retval = -EAGAIN;
smsc911x_mii_probe() returns an error code. It is better to use that,
than -EAGAIN, which is rather odd to start with.
quoted hunk ↗ jump to hunk
+ goto out;
+ }
}
/* Reset the LAN911x */
if (smsc911x_soft_reset(pdata)) {
SMSC_WARN(pdata, hw, "soft reset failed");
- return -EIO;
+ retval = -EIO;
+ goto mii_free_out;
smsc911x_soft_reset() also returns an error code you should use.
This patch also seems to do quite a few different things. Please can
you break it up into multiple patches.
Thanks
Andrew