With devices attached to a non-unifying 2.4GHz receiver we sometimes fail to get the name. This is not a fatal error, we can just continue with the original name. So instead of bailing out, continue with battery-initialization when this happens. This fixes the battery not getting registered when we fail to get the name. Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> --- drivers/hid/hid-logitech-hidpp.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index e7f082374943..ddaf6ac4ee57 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -3158,14 +3158,8 @@ static void hidpp_connect_event(struct hidpp_device *hidpp) } } - if (hidpp->name == hdev->name && hidpp->protocol_major >= 2) { - name = hidpp_get_device_name(hidpp); - if (!name) { - hid_err(hdev, - "unable to retrieve the name of the device"); - return; - } - + if (hidpp->name == hdev->name && hidpp->protocol_major >= 2 && + (name = hidpp_get_device_name(hidpp))) { devm_name = devm_kasprintf(&hdev->dev, GFP_KERNEL, "%s", name); kfree(name); if (!devm_name) -- 2.21.0