From 630096899120321791f0ca6fea7ad7f9bd572e20 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Mon, 31 Aug 2015 17:21:09 +0530 Subject: [PATCH] greybus: connection: staticize gb_connection_init() Its not used by external users, mark it static. This required some shuffling of the code. Reviewed-by: Bryan O'Donoghue Reviewed-by: Johan Hovold Signed-off-by: Viresh Kumar Signed-off-by: Johan Hovold --- drivers/staging/greybus/connection.c | 52 ++++++++++++++-------------- drivers/staging/greybus/connection.h | 1 - 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 286e7da3f275..62cbeb304616 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -163,31 +163,6 @@ int svc_update_connection(struct gb_interface *intf, return 0; } -void gb_connection_bind_protocol(struct gb_connection *connection) -{ - struct gb_protocol *protocol; - - /* If we already have a protocol bound here, just return */ - if (connection->protocol) - return; - - protocol = gb_protocol_get(connection->protocol_id, - connection->major, - connection->minor); - if (!protocol) - return; - connection->protocol = protocol; - - /* - * If we have a valid device_id for the interface block, then we have an - * active device, so bring up the connection at the same time. - */ - if ((!connection->bundle && - connection->hd_cport_id == GB_SVC_CPORT_ID) || - connection->bundle->intf->device_id != GB_DEVICE_ID_BAD) - gb_connection_init(connection); -} - /* * Set up a Greybus connection, representing the bidirectional link * between a CPort on a (local) Greybus host device and a CPort on @@ -391,7 +366,7 @@ static void gb_connection_disconnected(struct gb_connection *connection) "Failed to disconnect CPort-%d (%d)\n", cport_id, ret); } -int gb_connection_init(struct gb_connection *connection) +static int gb_connection_init(struct gb_connection *connection) { int cport_id = connection->intf_cport_id; int ret; @@ -480,3 +455,28 @@ void gb_hd_connections_exit(struct greybus_host_device *hd) gb_connection_destroy(connection); } } + +void gb_connection_bind_protocol(struct gb_connection *connection) +{ + struct gb_protocol *protocol; + + /* If we already have a protocol bound here, just return */ + if (connection->protocol) + return; + + protocol = gb_protocol_get(connection->protocol_id, + connection->major, + connection->minor); + if (!protocol) + return; + connection->protocol = protocol; + + /* + * If we have a valid device_id for the interface block, then we have an + * active device, so bring up the connection at the same time. + */ + if ((!connection->bundle && + connection->hd_cport_id == GB_SVC_CPORT_ID) || + connection->bundle->intf->device_id != GB_DEVICE_ID_BAD) + gb_connection_init(connection); +} diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h index a26a48033fc6..f1b5863820c5 100644 --- a/drivers/staging/greybus/connection.h +++ b/drivers/staging/greybus/connection.h @@ -61,7 +61,6 @@ struct gb_connection *gb_connection_create_range(struct greybus_host_device *hd, u32 ida_end); void gb_connection_destroy(struct gb_connection *connection); -int gb_connection_init(struct gb_connection *connection); void gb_connection_exit(struct gb_connection *connection); void gb_hd_connections_exit(struct greybus_host_device *hd); -- 2.20.1