aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-lg.h2
-rw-r--r--drivers/hid/usbhid/hid-core.c8
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/hid/hid-lg.h b/drivers/hid/hid-lg.h
index 27ae750ca878..bf31592eaf79 100644
--- a/drivers/hid/hid-lg.h
+++ b/drivers/hid/hid-lg.h
@@ -1,8 +1,6 @@
1#ifndef __HID_LG_H 1#ifndef __HID_LG_H
2#define __HID_LG_H 2#define __HID_LG_H
3 3
4#include <linux/autoconf.h>
5
6#ifdef CONFIG_LOGITECH_FF 4#ifdef CONFIG_LOGITECH_FF
7int lgff_init(struct hid_device *hdev); 5int lgff_init(struct hid_device *hdev);
8#else 6#else
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 0258289f3b3e..e2997a8d5e1b 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1253,10 +1253,9 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message)
1253{ 1253{
1254 struct hid_device *hid = usb_get_intfdata(intf); 1254 struct hid_device *hid = usb_get_intfdata(intf);
1255 struct usbhid_device *usbhid = hid->driver_data; 1255 struct usbhid_device *usbhid = hid->driver_data;
1256 struct usb_device *udev = interface_to_usbdev(intf);
1257 int status; 1256 int status;
1258 1257
1259 if (udev->auto_pm) { 1258 if (message.event & PM_EVENT_AUTO) {
1260 spin_lock_irq(&usbhid->lock); /* Sync with error handler */ 1259 spin_lock_irq(&usbhid->lock); /* Sync with error handler */
1261 if (!test_bit(HID_RESET_PENDING, &usbhid->iofl) 1260 if (!test_bit(HID_RESET_PENDING, &usbhid->iofl)
1262 && !test_bit(HID_CLEAR_HALT, &usbhid->iofl) 1261 && !test_bit(HID_CLEAR_HALT, &usbhid->iofl)
@@ -1281,7 +1280,7 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message)
1281 return -EIO; 1280 return -EIO;
1282 } 1281 }
1283 1282
1284 if (!ignoreled && udev->auto_pm) { 1283 if (!ignoreled && (message.event & PM_EVENT_AUTO)) {
1285 spin_lock_irq(&usbhid->lock); 1284 spin_lock_irq(&usbhid->lock);
1286 if (test_bit(HID_LED_ON, &usbhid->iofl)) { 1285 if (test_bit(HID_LED_ON, &usbhid->iofl)) {
1287 spin_unlock_irq(&usbhid->lock); 1286 spin_unlock_irq(&usbhid->lock);
@@ -1294,7 +1293,8 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message)
1294 hid_cancel_delayed_stuff(usbhid); 1293 hid_cancel_delayed_stuff(usbhid);
1295 hid_cease_io(usbhid); 1294 hid_cease_io(usbhid);
1296 1295
1297 if (udev->auto_pm && test_bit(HID_KEYS_PRESSED, &usbhid->iofl)) { 1296 if ((message.event & PM_EVENT_AUTO) &&
1297 test_bit(HID_KEYS_PRESSED, &usbhid->iofl)) {
1298 /* lost race against keypresses */ 1298 /* lost race against keypresses */
1299 status = hid_start_in(hid); 1299 status = hid_start_in(hid);
1300 if (status < 0) 1300 if (status < 0)