From 59a1d456ef3af7c2adbc77a60a3fc2a587b13594 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 9 Jan 2013 17:34:23 +0100 Subject: [PATCH] compat: fix warning in usb_autopm_get_interface_no_{resume,suspend} MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes the following warning on kernel version <= 2.6.31. /compat/compat-2.6.33.c: In function ‘usb_autopm_get_interface_no_resume’: /compat/compat-2.6.33.c:32:2: warning: passing argument 1 of ‘atomic_inc’ from incompatible pointer type [enabled by default] /arch/x86/include/asm/atomic_64.h:85:20: note: expected ‘struct atomic_t *’ but argument is of type ‘int *’ /compat/compat-2.6.33.c: In function ‘usb_autopm_put_interface_no_suspend’: /compat/compat-2.6.33.c:51:2: warning: passing argument 1 of ‘atomic_dec’ from incompatible pointer type [enabled by default] /arch/x86/include/asm/atomic_64.h:98:20: note: expected ‘struct atomic_t *’ but argument is of type ‘int *’ Signed-off-by: Hauke Mehrtens Signed-off-by: Luis R. Rodriguez --- compat/compat-2.6.33.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compat/compat-2.6.33.c b/compat/compat-2.6.33.c index 6d1c4d81efe4..f584b859ff1e 100644 --- a/compat/compat-2.6.33.c +++ b/compat/compat-2.6.33.c @@ -29,7 +29,11 @@ void usb_autopm_get_interface_no_resume(struct usb_interface *intf) struct usb_device *udev = interface_to_usbdev(intf); usb_mark_last_busy(udev); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) atomic_inc(&intf->pm_usage_cnt); +#else + intf->pm_usage_cnt++; +#endif pm_runtime_get_noresume(&intf->dev); } EXPORT_SYMBOL_GPL(usb_autopm_get_interface_no_resume); @@ -48,7 +52,11 @@ void usb_autopm_put_interface_no_suspend(struct usb_interface *intf) struct usb_device *udev = interface_to_usbdev(intf); usb_mark_last_busy(udev); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) atomic_dec(&intf->pm_usage_cnt); +#else + intf->pm_usage_cnt--; +#endif pm_runtime_put_noidle(&intf->dev); } EXPORT_SYMBOL_GPL(usb_autopm_put_interface_no_suspend); -- 2.30.2