[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-backports
Subject:    [RFC/RFT 37/42] backports: fix USB PM in case of !CONFIG_USB_SUSPEND
From:       Johannes Berg <johannes () sipsolutions ! net>
Date:       2013-04-13 23:53:57
Message-ID: 1365897243-31214-38-git-send-email-johannes () sipsolutions ! net
[Download RAW message or body]

From: Johannes Berg <johannes.berg@intel.com>

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 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 3821575..8ea9d75 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 */
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic