From: Benjamin Tissoires Date: Mon, 27 Mar 2017 14:59:23 +0000 (+0200) Subject: HID: logitech-hidpp: make sure we only register one battery per device X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=680de741e835d56e504997b613895058625291e9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git HID: logitech-hidpp: make sure we only register one battery per device Simple check to add, huge improvement :) Signed-off-by: Benjamin Tissoires Tested-by: Bastien Nocera Signed-off-by: Jiri Kosina --- 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)