From: Ming Lei Date: Tue, 19 Jun 2012 21:15:52 +0000 (+0000) Subject: usbnet: decrease suspend count if returning -EBUSY for runtime suspend X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5eeb3132eb4c5e9ca92e5247fe4575fe9f8c3efe;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git usbnet: decrease suspend count if returning -EBUSY for runtime suspend This patch decreases dev->suspend_count in the -EBUSY failure path of usbnet_suspend. Without the change, the later runtime suspend will do nothing except for increasing dev->suspend_count. Signed-off-by: Ming Lei Acked-by: Oliver Neukum Signed-off-by: David S. Miller --- diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 815493caea7f..1e46f693eb47 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1515,6 +1515,7 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message) spin_lock_irq(&dev->txq.lock); /* don't autosuspend while transmitting */ if (dev->txq.qlen && PMSG_IS_AUTO(message)) { + dev->suspend_count--; spin_unlock_irq(&dev->txq.lock); return -EBUSY; } else {