greybus: connection: add functions to get/set private data
authorGreg Kroah-Hartman <gregkh@google.com>
Tue, 22 Mar 2016 18:30:16 +0000 (14:30 -0400)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 22 Mar 2016 20:47:28 +0000 (16:47 -0400)
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>
drivers/staging/greybus/connection.h

index 6197d45cb16abfb0287a4a2da7666d13bc0e4f74..443d27bc3e350516ccf6ffdba66676da793194e7 100644 (file)
@@ -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 */