diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2017-03-27 17:59:23 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-04-06 15:36:36 +0300 |
commit | 680de741e835d56e504997b613895058625291e9 (patch) | |
tree | 5bae5f9c5df0a3fb648c34734ec785f8d6add2db /drivers | |
parent | 3861e6ca305c5262f0493e9141f0c52ba066a447 (diff) | |
download | linux-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')
-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) { int ret; + if (hidpp->battery.ps) + return 0; + if (hidpp->protocol_major >= 2) { ret = hidpp20_initialize_battery(hidpp); if (ret == 0) |