diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2017-03-27 10:59:23 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-04-06 08:36:36 -0400 |
commit | 680de741e835d56e504997b613895058625291e9 (patch) | |
tree | 5bae5f9c5df0a3fb648c34734ec785f8d6add2db | |
parent | 3861e6ca305c5262f0493e9141f0c52ba066a447 (diff) |
HID: logitech-hidpp: make sure we only register one battery per device
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>
-rw-r--r-- | drivers/hid/hid-logitech-hidpp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 4aaf2378897f..1cda29ec0efd 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c | |||
@@ -828,6 +828,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp) | |||
828 | { | 828 | { |
829 | int ret; | 829 | int ret; |
830 | 830 | ||
831 | if (hidpp->battery.ps) | ||
832 | return 0; | ||
833 | |||
831 | if (hidpp->protocol_major >= 2) { | 834 | if (hidpp->protocol_major >= 2) { |
832 | ret = hidpp20_initialize_battery(hidpp); | 835 | ret = hidpp20_initialize_battery(hidpp); |
833 | if (ret == 0) | 836 | if (ret == 0) |