Skip to content
Commit 658d04e6 authored by Hans de Goede's avatar Hans de Goede Committed by Jiri Kosina
Browse files

HID: lenovo: Fix lenovo_led_set_tp10ubkbd() error handling



Fix the following issues with lenovo_led_set_tp10ubkbd() error handling:

1. On success hid_hw_raw_request() returns the number of bytes sent.
   So we should check for (ret != 3) rather then for (ret != 0).

2. Actually propagate errors to the caller.

3. Since the LEDs are part of an USB keyboard-dock the mute LEDs can go
   away at any time. Don't log an error when ret == -ENODEV and set the
   LED_HW_PLUGGABLE flag to avoid errors getting logged when the USB gets
   disconnected.

Fixes: bc04b37e ("HID: lenovo: Add ThinkPad 10 Ultrabook Keyboard support")
Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent bbf62645
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