Skip to content

Commit

Permalink
HID: logitech-hidpp: make sure we only register one battery per device
Browse files Browse the repository at this point in the history
Simple check to add, huge improvement :)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
bentiss authored and Jiri Kosina committed Apr 6, 2017
1 parent 3861e6c commit 680de74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/hid/hid-logitech-hidpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
{
int ret;

if (hidpp->battery.ps)
return 0;

if (hidpp->protocol_major >= 2) {
ret = hidpp20_initialize_battery(hidpp);
if (ret == 0)
Expand Down

0 comments on commit 680de74

Please sign in to comment.