]> www.infradead.org Git - users/jedix/linux-maple.git/commit
HID: cp2112: hold the lock for the entire direction_output() call
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 23 Apr 2025 08:55:40 +0000 (10:55 +0200)
committerJiri Kosina <jkosina@suse.com>
Thu, 24 Apr 2025 10:07:55 +0000 (12:07 +0200)
commit837b05fea0752ee900abe57253d9f79ca46dd227
tree66168a6bc2174118164d1fc6611d5a91625d5a85
parenta99548b8343a46c1050fc041314bbbd27065169d
HID: cp2112: hold the lock for the entire direction_output() call

We currently take the lock, set direction to output, release it,
reacquire it and set the desired value. That doesn't look correct.
Introduce a helper function that sets the value without taking the lock
and use it where applicable in order to combine the critical sections.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-cp2112.c