USB: mcs7830: return negative if auto negotiate fails
Subsystems (4)
PATCH 1/1 USB: mcs7830: return negative if auto negotiate fails
The original code returns 0 on success and 1 on failure. In fact, at this point, "ret" is already either zero or a negative error code so we can just return it directly.
Signed-off-by Dan Carpenter <[email protected]>
drivers/net/usb/mcs7830.c +1 -1
@@ -351,7 +351,7 @@ static int mcs7830_set_autoneg(struct usbnet *dev, int ptrUserPhyMode)if (!ret) ret =mcs7830_write_phy (dev,MII_BMCR ,BMCR_ANENABLE |BMCR_ANRESTART ); -return ret <0 ? :0 ; +return ret; }
From: Dan Carpenter <[email protected]>
Date: Fri, 17 Dec 2010 16:25:43 +0300
Quoted 5 lines
The original code returns 0 on success and 1 on failure. In fact, at this point, "ret" is already either zero or a negative error code so we can just return it directly.
Signed-off-by Dan Carpenter <[email protected]>
Indeed, the USBNET ->bind() method, which this return value propagates to, expects negative return values on error.
Applied, and queued up for -stable, thanks Dan.