summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/operation.h
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-01-23 13:04:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-09 11:58:56 +0100
commitdbec27298b0df86eaa6bc02e5df0ce55ec7d97f2 (patch)
treeaaeae8679724ce4bdbe08e94e24b4660d0545ec9 /drivers/staging/greybus/operation.h
parenta769f30c7bd7cf917eea05a2b448f3588a87d767 (diff)
downloadlinux-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.h2
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);