From: Hauke Mehrtens Date: Wed, 9 Jan 2013 16:34:23 +0000 (+0100) Subject: compat: fix warning in usb_autopm_get_interface_no_{resume,suspend} X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=59a1d456ef3af7c2adbc77a60a3fc2a587b13594;p=openwrt%2Fstaging%2Fblogic.git compat: fix warning in usb_autopm_get_interface_no_{resume,suspend} 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 --- 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);