Skip to content

Commit 505f394

Browse files
dtorJiri Kosina
authored andcommitted
HID: hid-input: fix stylus battery reporting
With commit 4f38821 hid-input started clearing of "ignored" usages to avoid using garbage that might have been left in them. However "battery strength" usages should not be ignored, as we do want to use them. Fixes: 4f38821 ("HID: hid-input: clear unmapped usages") Reported-by: Kenneth Albanowski <[email protected]> Tested-by: Kenneth Albanowski <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent d9216d7 commit 505f394

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
797797
case 0x3b: /* Battery Strength */
798798
hidinput_setup_battery(device, HID_INPUT_REPORT, field);
799799
usage->type = EV_PWR;
800-
goto ignore;
800+
return;
801801

802802
case 0x3c: /* Invert */
803803
map_key_clear(BTN_TOOL_RUBBER);
@@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
10591059
case HID_DC_BATTERYSTRENGTH:
10601060
hidinput_setup_battery(device, HID_INPUT_REPORT, field);
10611061
usage->type = EV_PWR;
1062-
goto ignore;
1062+
return;
10631063
}
10641064
goto unknown;
10651065

0 commit comments

Comments
 (0)