backports: fix USB PM in case of !CONFIG_USB_SUSPEND
authorJohannes Berg <johannes.berg@intel.com>
Sat, 13 Apr 2013 13:19:29 +0000 (15:19 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 15 Apr 2013 09:32:48 +0000 (11:32 +0200)
Even in this case, the variable is an int on old kernels.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/backport-include/linux/usb.h

index 3821575ffcc0aa06d10f9cfe9ee0016580c20816..8ea9d75021a42d0f211286dec83f39a24b813839 100644 (file)
@@ -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 */