summaryrefslogtreecommitdiffstats
path: root/drivers/hid/wacom_sys.c
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2015-08-05 15:45:30 -0700
committerJiri Kosina <jikos@kernel.org>2015-08-10 10:47:10 +0200
commit64d0ed94f5dfde5efac15941128f60edf7f15c17 (patch)
tree37748961c94abf31da1f6e6d0ce7bf681afc7bd7 /drivers/hid/wacom_sys.c
parent3f14a63a544374225c17221a5058748360428dc3 (diff)
downloadlinux-64d0ed94f5dfde5efac15941128f60edf7f15c17.tar.gz
linux-64d0ed94f5dfde5efac15941128f60edf7f15c17.tar.bz2
linux-64d0ed94f5dfde5efac15941128f60edf7f15c17.zip
HID: wacom: Do not repeatedly attempt to set device mode on error
As an extension of aef3156d7, there is no sense in repeatedly calling the 'wacom_set_report' and 'wacom_get_report' functions if they return an error. Getting an error from them implies that the device is out to lunch: either a hard error code was returned or repeated attempts at recovering from a "soft" error all failed. In either case, doing even more retries is not likely to resolve whatever is wrong. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r--drivers/hid/wacom_sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 20d15c5fccec..6edb7d136476 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -335,7 +335,7 @@ static int wacom_set_device_mode(struct hid_device *hdev, int report_id,
if (error >= 0)
error = wacom_get_report(hdev, HID_FEATURE_REPORT,
rep_data, length, 1);
- } while ((error < 0 || rep_data[1] != mode) && limit++ < WAC_MSG_RETRIES);
+ } while (error >= 0 && rep_data[1] != mode && limit++ < WAC_MSG_RETRIES);
kfree(rep_data);