Skip to content

Commit 55cafca

Browse files
MavChtzJiri Kosina
authored andcommitted
HID: logitech-hidpp: Silence protocol errors on newer lightspeed receivers
When logitech-hidpp tries to communicate with an unreachable device paired to a 046d:c547 lightspeed receiver, the following message is printed to the console: hidpp_root_get_protocol_version: received protocol error 0x08 This occurs because this receiver returns 0x08 (HIDPP_ERROR_UNKNOWN_DEVICE) when a device is unreachable, compared to 0x09 (HIDPP_ERROR_RESOURCE_ERROR) that the older receivers return. This patch silences this harmless error by treating HIDPP_ERROR_UNKNOWN_DEVICE the same as HIDPP_ERROR_RESOURCE_ERROR in hidpp_root_get_protocol_version(). There are other checks for HIDPP_ERROR_RESOURCE_ERROR found in battery-related functions, however this receiver does not trigger them when the device is disconnected. Signed-off-by: Mavroudis Chatzilazaridis <mavchatz@protonmail.com> Tested-by: Stuart Hayhurst <stuart.a.hayhurst@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent 5329fc3 commit 55cafca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/hid/hid-logitech-hidpp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,8 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp)
969969
}
970970

971971
/* the device might not be connected */
972-
if (ret == HIDPP_ERROR_RESOURCE_ERROR)
972+
if (ret == HIDPP_ERROR_RESOURCE_ERROR ||
973+
ret == HIDPP_ERROR_UNKNOWN_DEVICE)
973974
return -EIO;
974975

975976
if (ret > 0) {

0 commit comments

Comments
 (0)