Commit 814b6d17 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Jiri Kosina

HID: hidraw: fix power sequence when closing device

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: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Reviewed-by: default avatarBenson Leung <bleung@chromium.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 2a5e597c
...@@ -337,8 +337,8 @@ static void drop_ref(struct hidraw *hidraw, int exists_bit) ...@@ -337,8 +337,8 @@ static void drop_ref(struct hidraw *hidraw, int exists_bit)
kfree(hidraw); kfree(hidraw);
} else { } else {
/* close device for last reader */ /* close device for last reader */
hid_hw_power(hidraw->hid, PM_HINT_NORMAL);
hid_hw_close(hidraw->hid); hid_hw_close(hidraw->hid);
hid_hw_power(hidraw->hid, PM_HINT_NORMAL);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment