greybus: cancel operation on timeout
authorAlex Elder <elder@linaro.org>
Sat, 22 Nov 2014 01:29:17 +0000 (19:29 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Sat, 22 Nov 2014 03:36:42 +0000 (19:36 -0800)
commitf68c05c0216e09ed93b12894747d8583dc5b8f8e
tree95e3579a3c9f83f66ebc19c36f501e57e5e8fff0
parent0e3d0e8fad52ed478647a1a122e21c7deb7f96cf
greybus: cancel operation on timeout

If an operation times out, we need to cancel whatever message it
has in-flight.  Do that instead of completing the operation, in the
timeout handler.  When the in-flight request message is canceled its
completion function will lead to the proper completion of the
operation.

Change gb_operation_cancel() so it takes the errno that it's
supposed to assign as the result of the operation.

Note that we want to preserve the original -ETIMEDOUT error, so
don't overwrite the operation result value if it has already been
set.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/connection.c
drivers/staging/greybus/operation.c
drivers/staging/greybus/operation.h