summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2017-03-27 17:59:23 +0300
committerJiri Kosina <jkosina@suse.cz>2017-04-06 15:36:36 +0300
commit680de741e835d56e504997b613895058625291e9 (patch)
tree5bae5f9c5df0a3fb648c34734ec785f8d6add2db /drivers/hid
parent3861e6ca305c5262f0493e9141f0c52ba066a447 (diff)
downloadlinux-680de741e835d56e504997b613895058625291e9.tar.xz
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>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-logitech-hidpp.c3
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)
{
int ret;
+ if (hidpp->battery.ps)
+ return 0;
+
if (hidpp->protocol_major >= 2) {
ret = hidpp20_initialize_battery(hidpp);
if (ret == 0)