[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160901165806.GC10951@lunn.ch>
Date: Thu, 1 Sep 2016 18:58:06 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jeremy Linton <jeremy.linton@....com>
Cc: netdev@...r.kernel.org, steve.glendinning@...well.net,
sergei.shtylyov@...entembedded.com
Subject: Re: [PATCH 1/2] net: smsc911x: Fix register_netdev, phy startup,
driver unload ordering
> @@ -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.
> + 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
Powered by blists - more mailing lists