diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2017-03-27 16:59:23 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-04-06 14:36:36 +0200 |
commit | 680de741e835d56e504997b613895058625291e9 (patch) | |
tree | 5bae5f9c5df0a3fb648c34734ec785f8d6add2db /drivers/hid | |
parent | 3861e6ca305c5262f0493e9141f0c52ba066a447 (diff) | |
download | linux-680de741e835d56e504997b613895058625291e9.tar.bz2 |
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.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) |