]> Git Repo - linux.git/commitdiff
HID: hidraw: fix power sequence when closing device
authorDmitry Torokhov <[email protected]>
Wed, 20 Sep 2017 01:37:46 +0000 (18:37 -0700)
committerJiri Kosina <[email protected]>
Mon, 2 Oct 2017 09:46:31 +0000 (11:46 +0200)
We should not try to bring HID device out of full power state before
calling hid_hw_close(), so that transport driver operates on powered up
device (making this inverse of the opening sequence).

Signed-off-by: Dmitry Torokhov <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Reviewed-by: Benson Leung <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
drivers/hid/hidraw.c

index ec530454e6f68789fe57444fba14eb1daae94e2e..5fbe0f81ab2ebd2c972237fa1be2bc3b544afee8 100644 (file)
@@ -337,8 +337,8 @@ static void drop_ref(struct hidraw *hidraw, int exists_bit)
                        kfree(hidraw);
                } else {
                        /* close device for last reader */
-                       hid_hw_power(hidraw->hid, PM_HINT_NORMAL);
                        hid_hw_close(hidraw->hid);
+                       hid_hw_power(hidraw->hid, PM_HINT_NORMAL);
                }
        }
 }
This page took 0.0560619999999999 seconds and 4 git commands to generate.