diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2006-09-26 22:50:20 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-29 02:36:46 +0400 |
commit | e0318ebff4d96131bb3524308b845f642e64df81 (patch) | |
tree | 20cc60b491fc9694521a48a996075e652ab9de49 /drivers/usb/core/usb.h | |
parent | 8d1a243ba5dda5c1a3cca5df8fb19ab8b138f074 (diff) | |
download | linux-e0318ebff4d96131bb3524308b845f642e64df81.tar.xz |
USB: fix autosuspend when CONFIG_PM isn't set
This patch (as791b) fixes things up to avoid compiler warnings or
errors when CONFIG_USB_SUSPEND or CONFIG_PM isn't set.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/usb.h')
-rw-r--r-- | drivers/usb/core/usb.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index fb6eb41c374f..f69df137ec0e 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -36,6 +36,16 @@ extern int usb_resume_both(struct usb_device *udev); extern int usb_port_suspend(struct usb_device *dev); extern int usb_port_resume(struct usb_device *dev); +static inline void usb_pm_lock(struct usb_device *udev) +{ + mutex_lock_nested(&udev->pm_mutex, udev->level); +} + +static inline void usb_pm_unlock(struct usb_device *udev) +{ + mutex_unlock(&udev->pm_mutex); +} + #else #define usb_suspend_both(udev, msg) 0 @@ -45,6 +55,8 @@ static inline int usb_resume_both(struct usb_device *udev) } #define usb_port_suspend(dev) 0 #define usb_port_resume(dev) 0 +static inline void usb_pm_lock(struct usb_device *udev) {} +static inline void usb_pm_unlock(struct usb_device *udev) {} #endif @@ -58,7 +70,11 @@ extern int usb_autoresume_device(struct usb_device *udev, int inc_busy_cnt); #else #define usb_autosuspend_device(udev, dec_busy_cnt) do {} while (0) -#define usb_autoresume_device(udev, inc_busy_cnt) 0 +static inline int usb_autoresume_device(struct usb_device *udev, + int inc_busy_cnt) +{ + return 0; +} #endif |