]> git.hungrycats.org Git - linux/commit
HID: logitech-hidpp: rework one more time the retries attempts
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Wed, 12 Jul 2023 15:02:34 +0000 (17:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:43 +0000 (09:48 +0200)
commitafe98365be9501cfe2280be580b423de69e25609
treec7bc813f96d4d62941bd7fc5d08d8409af453710
parent90819a4a919ff0fae584faf3ac34bd1ed1edfbb5
HID: logitech-hidpp: rework one more time the retries attempts

commit 60165ab774cb0c509680a73cf826d0e158454653 upstream.

Extract the internal code inside a helper function, fix the
initialization of the parameters used in the helper function
(`hidpp->answer_available` was not reset and `*response` wasn't either),
and use a `do {...} while();` loop.

Fixes: 586e8fede795 ("HID: logitech-hidpp: Retry commands when device is busy")
Cc: stable@vger.kernel.org
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20230621-logitech-fixes-v2-1-3635f7f9c8af@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-logitech-hidpp.c