aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-11-13 11:53:59 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:55:21 -0500
commitfb34d53752d5bec5acc73422e462a9c68aeeaa2a (patch)
tree6a395f2a0246cd3d721753c60af13e8f9b2e9c41 /drivers/hid
parent576a362ad2103da481e1f6e13de01f33d3d4c7b1 (diff)
USB: remove the auto_pm flag
This patch (as1302) removes the auto_pm flag from struct usb_device. The flag's only purpose was to distinguish between autosuspends and external suspends, but that information is now available in the pm_message_t argument passed to suspend methods. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/usbhid/hid-core.c8
1 files changed, 4 insertions, 4 deletions
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)