compat: fix warning in usb_autopm_get_interface_no_{resume,suspend}
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 9 Jan 2013 16:34:23 +0000 (17:34 +0100)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 10 Jan 2013 21:11:25 +0000 (13:11 -0800)
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 <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
compat/compat-2.6.33.c

index 6d1c4d81efe4545a9a3c5f256d6b6b41c61db9e3..f584b859ff1ecf2c3e5ec7c4457d9572676b28e2 100644 (file)
@@ -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);