Commit 090760d4 authored by Hans de Goede's avatar Hans de Goede Committed by Jiri Kosina

HID: logitech-hidpp: remove hidpp_is_connected()

Remove the hidpp_is_connected() function wrapper, and have the callers
directly call hidpp_root_get_protocol_version() instead.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 9576af6a
...@@ -871,11 +871,6 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp) ...@@ -871,11 +871,6 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp)
return 0; return 0;
} }
static bool hidpp_is_connected(struct hidpp_device *hidpp)
{
return hidpp_root_get_protocol_version(hidpp) == 0;
}
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* 0x0005: GetDeviceNameType */ /* 0x0005: GetDeviceNameType */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
...@@ -3125,7 +3120,7 @@ static void hidpp_connect_event(struct hidpp_device *hidpp) ...@@ -3125,7 +3120,7 @@ static void hidpp_connect_event(struct hidpp_device *hidpp)
/* the device is already connected, we can ask for its name and /* the device is already connected, we can ask for its name and
* protocol */ * protocol */
if (!hidpp->protocol_major) { if (!hidpp->protocol_major) {
ret = !hidpp_is_connected(hidpp); ret = hidpp_root_get_protocol_version(hidpp);
if (ret) { if (ret) {
hid_err(hdev, "Can not get the protocol version.\n"); hid_err(hdev, "Can not get the protocol version.\n");
return; return;
...@@ -3277,7 +3272,7 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -3277,7 +3272,7 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (hidpp->quirks & HIDPP_QUIRK_UNIFYING) if (hidpp->quirks & HIDPP_QUIRK_UNIFYING)
hidpp_unifying_init(hidpp); hidpp_unifying_init(hidpp);
connected = hidpp_is_connected(hidpp); connected = hidpp_root_get_protocol_version(hidpp) == 0;
atomic_set(&hidpp->connected, connected); atomic_set(&hidpp->connected, connected);
if (!(hidpp->quirks & HIDPP_QUIRK_UNIFYING)) { if (!(hidpp->quirks & HIDPP_QUIRK_UNIFYING)) {
if (!connected) { if (!connected) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment