aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-logitech-hidpp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index db15cfc622c4..b0d2fea7ec56 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2443,13 +2443,7 @@ static void hidpp_connect_event(struct hidpp_device *hidpp)
2443 hidpp->protocol_major, hidpp->protocol_minor); 2443 hidpp->protocol_major, hidpp->protocol_minor);
2444 } 2444 }
2445 2445
2446 hidpp_initialize_battery(hidpp); 2446 if (hidpp->name == hdev->name && hidpp->protocol_major >= 2) {
2447
2448 if (!(hidpp->quirks & HIDPP_QUIRK_NO_HIDINPUT))
2449 /* if HID created the input nodes for us, we can stop now */
2450 return;
2451
2452 if (!hidpp->name || hidpp->name == hdev->name) {
2453 name = hidpp_get_device_name(hidpp); 2447 name = hidpp_get_device_name(hidpp);
2454 if (!name) { 2448 if (!name) {
2455 hid_err(hdev, 2449 hid_err(hdev,
@@ -2465,6 +2459,12 @@ static void hidpp_connect_event(struct hidpp_device *hidpp)
2465 hidpp->name = devm_name; 2459 hidpp->name = devm_name;
2466 } 2460 }
2467 2461
2462 hidpp_initialize_battery(hidpp);
2463
2464 if (!(hidpp->quirks & HIDPP_QUIRK_NO_HIDINPUT))
2465 /* if HID created the input nodes for us, we can stop now */
2466 return;
2467
2468 input = hidpp_allocate_input(hdev); 2468 input = hidpp_allocate_input(hdev);
2469 if (!input) { 2469 if (!input) {
2470 hid_err(hdev, "cannot allocate new input device: %d\n", ret); 2470 hid_err(hdev, "cannot allocate new input device: %d\n", ret);