Thread (36 messages) 36 messages, 4 authors, 2017-06-06
STALE3284d
Revisions (2)
  1. v2 [diff vs current]
  2. v3 current

[PATCH v3 03/19] HID: logitech-hidpp: make sure we only register one battery per device

From: Benjamin Tissoires <hidden>
Date: 2017-03-27 15:02:07
Also in: lkml
Subsystem: hid core layer, hid logitech drivers, hid++ logitech drivers, the rest · Maintainers: Jiri Kosina, Benjamin Tissoires, Linus Torvalds

Simple check to add, huge improvement :)

Signed-off-by: Benjamin Tissoires <redacted>

---

no changes in v3

no changes in v2
---
 drivers/hid/hid-logitech-hidpp.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 4aaf237..1cda29e 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)
-- 
2.9.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help