summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2016-03-22 19:30:16 +0100
committerGreg Kroah-Hartman2016-03-22 21:47:28 +0100
commit418f3dab841f85e24beb6e30858cafce5cf1f87c (patch)
tree2e6691107e3ee668ed1e47f73b63dd81325995a1 /drivers/staging/greybus/connection.h
parentgreybus: greybus_trace: Fix broken greybus ftrace (diff)
downloadkernel-qcow2-linux-418f3dab841f85e24beb6e30858cafce5cf1f87c.tar.gz
kernel-qcow2-linux-418f3dab841f85e24beb6e30858cafce5cf1f87c.tar.xz
kernel-qcow2-linux-418f3dab841f85e24beb6e30858cafce5cf1f87c.zip
greybus: connection: add functions to get/set private data
Add gb_connection_get_data() and gb_connection_set_data() to get and set the private data of a connection, instead of "open coding" it everywhere. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.h')
-rw-r--r--drivers/staging/greybus/connection.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h
index 6197d45cb16a..443d27bc3e35 100644
--- a/drivers/staging/greybus/connection.h
+++ b/drivers/staging/greybus/connection.h
@@ -88,4 +88,15 @@ static inline bool gb_connection_e2efc_enabled(struct gb_connection *connection)
return !(connection->flags & GB_CONNECTION_FLAG_CSD);
}
+static inline void *gb_connection_get_data(struct gb_connection *connection)
+{
+ return connection->private;
+}
+
+static inline void gb_connection_set_data(struct gb_connection *connection,
+ void *data)
+{
+ connection->private = data;
+}
+
#endif /* __CONNECTION_H */