From: Greg Kroah-Hartman Date: Tue, 22 Mar 2016 18:30:16 +0000 (-0400) Subject: greybus: connection: add functions to get/set private data X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=418f3dab841f85e24beb6e30858cafce5cf1f87c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- 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 */