summaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-03-15 12:08:53 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 10:55:46 -0700
commit303f0847925ece27129487a2bfc05199ab2a0b51 (patch)
treed368d2f9376bb452d9c79f466c710a5d7d38b64e /include/linux/usb.h
parent2849a3a945d0e440fa245c47c49c80ef1cc103c3 (diff)
USB: adds comment on suspend callback
This patch adds comments on interface driver suspend callback to emphasize that the failure return value is ignored by USB core in system sleep context, so do not try to recover device for this case and let resume/reset_resume callback handle the suspend failure if needed. Also kerneldoc for usb_suspend_both() is updated with the fact. Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 52464fb2389..8d4bc173d66 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -976,7 +976,12 @@ struct usbdrv_wrap {
* the "usbfs" filesystem. This lets devices provide ways to
* expose information to user space regardless of where they
* do (or don't) show up otherwise in the filesystem.
- * @suspend: Called when the device is going to be suspended by the system.
+ * @suspend: Called when the device is going to be suspended by the
+ * system either from system sleep or runtime suspend context. The
+ * return value will be ignored in system sleep context, so do NOT
+ * try to continue using the device if suspend fails in this case.
+ * Instead, let the resume or reset-resume routine recover from
+ * the failure.
* @resume: Called when the device is being resumed by the system.
* @reset_resume: Called when the suspended device has been reset instead
* of being resumed.