]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/hid/usbhid/hid-core.c
Merge branch 'master' into upstream
[linux-2.6.git] / drivers / hid / usbhid / hid-core.c
index eb7e0019891f6a83cfb0ba72af05fcfa517c26e9..54060741d45b2ceddca10bb6a64dbd6af0071afb 100644 (file)
@@ -1253,10 +1253,9 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message)
 {
        struct hid_device *hid = usb_get_intfdata(intf);
        struct usbhid_device *usbhid = hid->driver_data;
-       struct usb_device *udev = interface_to_usbdev(intf);
        int status;
 
-       if (udev->auto_pm) {
+       if (message.event & PM_EVENT_AUTO) {
                spin_lock_irq(&usbhid->lock);   /* Sync with error handler */
                if (!test_bit(HID_RESET_PENDING, &usbhid->iofl)
                    && !test_bit(HID_CLEAR_HALT, &usbhid->iofl)
@@ -1281,7 +1280,7 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message)
                        return -EIO;
        }
 
-       if (!ignoreled && udev->auto_pm) {
+       if (!ignoreled && (message.event & PM_EVENT_AUTO)) {
                spin_lock_irq(&usbhid->lock);
                if (test_bit(HID_LED_ON, &usbhid->iofl)) {
                        spin_unlock_irq(&usbhid->lock);
@@ -1294,7 +1293,8 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message)
        hid_cancel_delayed_stuff(usbhid);
        hid_cease_io(usbhid);
 
-       if (udev->auto_pm && test_bit(HID_KEYS_PRESSED, &usbhid->iofl)) {
+       if ((message.event & PM_EVENT_AUTO) &&
+                       test_bit(HID_KEYS_PRESSED, &usbhid->iofl)) {
                /* lost race against keypresses */
                status = hid_start_in(hid);
                if (status < 0)