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>
This commit is contained in:
Benjamin Tissoires 2017-03-27 16:59:23 +02:00 committed by Jiri Kosina
parent 3861e6ca30
commit 680de741e8

View File

@ -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)