HID: wacom: Have wacom_{get,set}_report retry on -EAGAIN, not -EPIPE
authorJason Gerecke <killertofu@gmail.com>
Thu, 21 May 2015 17:44:31 +0000 (10:44 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 21 May 2015 19:37:38 +0000 (21:37 +0200)
commitaef3156d7294ac878c10ca8f02539b49adee9624
tree8d1ffb28198e4597e346717be6531c7e2e973772
parent8e116d3169cc2b93b7eb2f44dc021a93cd3d5308
HID: wacom: Have wacom_{get,set}_report retry on -EAGAIN, not -EPIPE

Retrying on -EPIPE makes very little sense since this typically indicates
a problem that will not just disappear on its own. For instance, the USB
documentation states that it will be sent if the endpoint is stalled or
the device has disconnected. Instead, we should retry if -EAGAIN is
received since this indicates a temporary error condition such as a busy
bus.

In addition to adjusting the conditions we retry under, we also log an
error on failure so that we can be aware of what's going on.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom_sys.c