Skip to content

Commit 61005d6

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
HID: logitech-hidpp: Silence intermittent get_battery_capacity errors
My Logitech M185 (PID:4038) 2.4 GHz wireless HID++ mouse is causing intermittent errors like these in the log: [11091.034857] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09 [12388.031260] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09 [16613.718543] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09 [23529.938728] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09 We are already silencing error-code 0x09 (HIDPP_ERROR_RESOURCE_ERROR) errors in other places, lets do the same in hidpp20_batterylevel_get_battery_capacity to remove these harmless, but scary looking errors from the dmesg output. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent bdd08ff commit 61005d6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,9 @@ static int hidpp20_batterylevel_get_battery_capacity(struct hidpp_device *hidpp,
11021102
ret = hidpp_send_fap_command_sync(hidpp, feature_index,
11031103
CMD_BATTERY_LEVEL_STATUS_GET_BATTERY_LEVEL_STATUS,
11041104
NULL, 0, &response);
1105+
/* Ignore these intermittent errors */
1106+
if (ret == HIDPP_ERROR_RESOURCE_ERROR)
1107+
return -EIO;
11051108
if (ret > 0) {
11061109
hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
11071110
__func__, ret);

0 commit comments

Comments
 (0)