[PATCH 3/6] staging: greybus/operation: add async_private data with get/set accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 operation.h and get/set
methods to access that pointer.

Signed-off-by: Bryan O'Donoghue <pure.logic at nexus-software.ie>
---
 drivers/staging/greybus/operation.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h
index f4e874d..abac960 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			*async_private;
 };
 
 static inline bool
@@ -209,6 +211,17 @@ static inline int gb_operation_unidirectional(struct gb_connection *connection,
 			request, request_size, GB_OPERATION_TIMEOUT_DEFAULT);
 }
 
+static inline void *gb_operation_get_async_data(struct gb_operation *operation)
+{
+	return operation->async_private;
+}
+
+static inline void gb_operation_set_async_data(struct gb_operation *operation,
+					       void *data)
+{
+	operation->async_private = data;
+}
+
 int gb_operation_init(void);
 void gb_operation_exit(void);
 
-- 
2.7.4



[Index of Archives]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]

  Powered by Linux