Skip to content

Commit

Permalink
HID: wacom: Do not repeatedly attempt to set device mode on error
Browse files Browse the repository at this point in the history
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 <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
jigpu authored and Jiri Kosina committed Aug 10, 2015
1 parent ba53219 commit a1c173d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a1c173d

Please sign in to comment.