Skip to content

Commit a1c173d

Browse files
jigpuJiri Kosina
authored andcommitted
HID: wacom: Do not repeatedly attempt to set device mode on error
As an extension of aef3156, 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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent ba53219 commit a1c173d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/wacom_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static int wacom_set_device_mode(struct hid_device *hdev, int report_id,
335335
if (error >= 0)
336336
error = wacom_get_report(hdev, HID_FEATURE_REPORT,
337337
rep_data, length, 1);
338-
} while ((error < 0 || rep_data[1] != mode) && limit++ < WAC_MSG_RETRIES);
338+
} while (error >= 0 && rep_data[1] != mode && limit++ < WAC_MSG_RETRIES);
339339

340340
kfree(rep_data);
341341

0 commit comments

Comments
 (0)