From cfabd926f92c8821251fed6af4868755d896347b Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 13 Apr 2013 15:19:29 +0200 Subject: [PATCH] backports: fix USB PM in case of !CONFIG_USB_SUSPEND Even in this case, the variable is an int on old kernels. Signed-off-by: Johannes Berg --- backport/backport-include/linux/usb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h index 3821575ffcc0..8ea9d75021a4 100644 --- a/backport/backport-include/linux/usb.h +++ b/backport/backport-include/linux/usb.h @@ -83,11 +83,19 @@ extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf); #else static inline void usb_autopm_get_interface_no_resume(struct usb_interface *intf) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) atomic_inc(&intf->pm_usage_cnt); +#else + intf->pm_usage_cnt++; +#endif } static inline void usb_autopm_put_interface_no_suspend(struct usb_interface *intf) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) atomic_dec(&intf->pm_usage_cnt); +#else + intf->pm_usage_cnt--; +#endif } #endif /* CONFIG_USB_SUSPEND */ #endif /* < 2.6.33 */ -- 2.30.2