summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-02-22 03:05:03 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-14 11:26:35 -0700
commit53be86cb15c4a7b1a0f5bbfa0c566c168891ae52 (patch)
treeecc5aa135a0f85727143bdad17dc4c87f8c410dd /drivers
parentd79ba09797140b624e8b0e71e67c5afc6bca797d (diff)
downloadlinux-stable-53be86cb15c4a7b1a0f5bbfa0c566c168891ae52.tar.gz
linux-stable-53be86cb15c4a7b1a0f5bbfa0c566c168891ae52.tar.bz2
linux-stable-53be86cb15c4a7b1a0f5bbfa0c566c168891ae52.zip
usbnet: smsc95xx: fix suspend failure
commit 7643721471117d5f62ca36f328d3dc8d84af4402 upstream. The three below functions: smsc95xx_enter_suspend0() smsc95xx_enter_suspend1() smsc95xx_enter_suspend2() return > 0 in case of success, so they will cause smsc95xx_suspend() to return > 0 and cause suspend failure. The bug is introduced in commit 3b9f7d(smsc95xx: fix error handling in suspend failure case). Signed-off-by: Ming Lei <ming.lei@canonical.com> Cc: Steve Glendinning <steve.glendinning@shawell.net> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/smsc95xx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 9b736701f854..6214181298dc 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1340,6 +1340,8 @@ static int smsc95xx_enter_suspend0(struct usbnet *dev)
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
if (ret < 0)
netdev_warn(dev->net, "Error reading PM_CTRL\n");
+ else
+ ret = 0;
return ret;
}
@@ -1392,6 +1394,8 @@ static int smsc95xx_enter_suspend1(struct usbnet *dev)
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
if (ret < 0)
netdev_warn(dev->net, "Error writing PM_CTRL\n");
+ else
+ ret = 0;
return ret;
}
@@ -1413,6 +1417,8 @@ static int smsc95xx_enter_suspend2(struct usbnet *dev)
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
if (ret < 0)
netdev_warn(dev->net, "Error writing PM_CTRL\n");
+ else
+ ret = 0;
return ret;
}