diff options
author | Johan Hovold <johan@kernel.org> | 2017-01-23 13:04:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-09 11:58:56 +0100 |
commit | dbec27298b0df86eaa6bc02e5df0ce55ec7d97f2 (patch) | |
tree | aaeae8679724ce4bdbe08e94e24b4660d0545ec9 /drivers/staging/greybus/operation.h | |
parent | a769f30c7bd7cf917eea05a2b448f3588a87d767 (diff) | |
download | linux-dbec27298b0df86eaa6bc02e5df0ce55ec7d97f2.tar.bz2 |
staging: greybus: operation: add generic timeout support
Add a struct timer_list to struct gb_operation and use that to implement
generic operation timeouts.
This simplifies the synchronous operation handling somewhat while also
providing a generic timeout mechanism that drivers can use for
asynchronous operations.
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus/operation.h')
-rw-r--r-- | drivers/staging/greybus/operation.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h index de09a2c7de54..7529f01b2529 100644 --- a/drivers/staging/greybus/operation.h +++ b/drivers/staging/greybus/operation.h @@ -98,6 +98,7 @@ struct gb_operation { struct work_struct work; gb_operation_callback callback; struct completion completion; + struct timer_list timer; struct kref kref; atomic_t waiters; @@ -164,6 +165,7 @@ bool gb_operation_response_alloc(struct gb_operation *operation, int gb_operation_request_send(struct gb_operation *operation, gb_operation_callback callback, + unsigned int timeout, gfp_t gfp); int gb_operation_request_send_sync_timeout(struct gb_operation *operation, unsigned int timeout); |