aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-11-03 16:09:59 -0500
committerJiri Kosina <jkosina@suse.cz>2014-11-04 05:10:19 -0500
commit552f12eb68440a0328dc9929066f6d0321a75874 (patch)
treed288bba4f78144ca1437851a353a0fd708fa7298
parent8c9952b26b2be25311706082598e5e176eb92748 (diff)
HID: logitech-hidpp: 2 fixes in hidpp_root_get_protocol_version()
- remove the constant '1' - when the device is not connected, the protocol error HIDPP_ERROR_RESOURCE_ERROR is raised. We should not warn the user about it because it is somewhat expected as an answer when we check if the device is connected. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-logitech-hidpp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 61f9e75c45d2..1a6395d0c2bd 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -361,12 +361,16 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp)
361 CMD_ROOT_GET_PROTOCOL_VERSION, 361 CMD_ROOT_GET_PROTOCOL_VERSION,
362 NULL, 0, &response); 362 NULL, 0, &response);
363 363
364 if (ret == 1) { 364 if (ret == HIDPP_ERROR_INVALID_SUBID) {
365 hidpp->protocol_major = 1; 365 hidpp->protocol_major = 1;
366 hidpp->protocol_minor = 0; 366 hidpp->protocol_minor = 0;
367 return 0; 367 return 0;
368 } 368 }
369 369
370 /* the device might not be connected */
371 if (ret == HIDPP_ERROR_RESOURCE_ERROR)
372 return -EIO;
373
370 if (ret > 0) { 374 if (ret > 0) {
371 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", 375 hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
372 __func__, ret); 376 __func__, ret);