From 8cff6c6473db471d7da9dd6dfbfcebdc4d617aa8 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 21 Jan 2016 17:34:14 +0100 Subject: [PATCH] greybus: connection: simplify connection-creation interface Simplify the exported generic interface for creating dynamic connections. Since all driver connections will have a bundle we can drop the redundant interface parameter. Reviewed-by: Viresh Kumar Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/connection.c | 6 +++--- drivers/staging/greybus/connection.h | 4 ++-- drivers/staging/greybus/legacy.c | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 8c7f2ea..227bfe8 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -225,10 +225,10 @@ gb_connection_create_control(struct gb_interface *intf) } struct gb_connection * -gb_connection_create_dynamic(struct gb_interface *intf, - struct gb_bundle *bundle, - u16 cport_id) +gb_connection_create_dynamic(struct gb_bundle *bundle, u16 cport_id) { + struct gb_interface *intf = bundle->intf; + return gb_connection_create(intf->hd, -1, intf, bundle, cport_id); } EXPORT_SYMBOL_GPL(gb_connection_create_dynamic); diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h index 442bd49..863109c 100644 --- a/drivers/staging/greybus/connection.h +++ b/drivers/staging/greybus/connection.h @@ -58,8 +58,8 @@ struct gb_connection { struct gb_connection *gb_connection_create_static(struct gb_host_device *hd, u16 hd_cport_id); struct gb_connection *gb_connection_create_control(struct gb_interface *intf); -struct gb_connection *gb_connection_create_dynamic(struct gb_interface *intf, - struct gb_bundle *bundle, u16 cport_id); +struct gb_connection *gb_connection_create_dynamic(struct gb_bundle *bundle, + u16 cport_id); void gb_connection_destroy(struct gb_connection *connection); static inline bool gb_connection_is_static(struct gb_connection *connection) diff --git a/drivers/staging/greybus/legacy.c b/drivers/staging/greybus/legacy.c index c34764f..86ab7b7 100644 --- a/drivers/staging/greybus/legacy.c +++ b/drivers/staging/greybus/legacy.c @@ -153,8 +153,7 @@ static int legacy_probe(struct gb_bundle *bundle, for (i = 0; i < data->num_cports; ++i) { cport_desc = &bundle->cport_desc[i]; - connection = gb_connection_create_dynamic(bundle->intf, - bundle, + connection = gb_connection_create_dynamic(bundle, le16_to_cpu(cport_desc->id)); if (!connection) goto err_connections_destroy; -- 2.7.4