diff options
author | Bryan O'Donoghue <pure.logic@nexus-software.ie> | 2017-11-06 01:32:21 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-06 16:41:22 +0100 |
commit | 200543c1b94da9249b35ea1b8726cd0cdee128d5 (patch) | |
tree | 3acca9449a1f2919bef2ba14b15beb8b44436be6 /drivers/staging/greybus | |
parent | 44b02da39210e6dd67e39ff1f48d30c56d384240 (diff) | |
download | linux-stable-200543c1b94da9249b35ea1b8726cd0cdee128d5.tar.gz linux-stable-200543c1b94da9249b35ea1b8726cd0cdee128d5.tar.bz2 linux-stable-200543c1b94da9249b35ea1b8726cd0cdee128d5.zip |
staging: greybus: operation: add private data with get/set accessors
Asynchronous operation completion handler's lives are made easier if there
is a generic pointer that can store private data associated with the
operation. This patch adds a pointer field to struct gb_operation and
get/set methods to access that pointer.
Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alex Elder <elder@kernel.org>
Cc: Mitch Tasman <tasman@leaflabs.com>
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r-- | drivers/staging/greybus/operation.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h index 7529f01b2529..bfec1e93384e 100644 --- a/drivers/staging/greybus/operation.h +++ b/drivers/staging/greybus/operation.h @@ -105,6 +105,8 @@ struct gb_operation { int active; struct list_head links; /* connection->operations */ + + void *private; }; static inline bool @@ -206,6 +208,17 @@ static inline int gb_operation_unidirectional(struct gb_connection *connection, request, request_size, GB_OPERATION_TIMEOUT_DEFAULT); } +static inline void *gb_operation_get_data(struct gb_operation *operation) +{ + return operation->private; +} + +static inline void gb_operation_set_data(struct gb_operation *operation, + void *data) +{ + operation->private = data; +} + int gb_operation_init(void); void gb_operation_exit(void); |