greybus: connection: staticize gb_connection_init()
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 31 Aug 2015 11:51:09 +0000 (17:21 +0530)
committerJohan Hovold <johan@hovoldconsulting.com>
Thu, 3 Sep 2015 12:36:31 +0000 (14:36 +0200)
Its not used by external users, mark it static. This required some
shuffling of the code.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
drivers/staging/greybus/connection.c
drivers/staging/greybus/connection.h

index 286e7da..62cbeb3 100644 (file)
@@ -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);
+}
index a26a480..f1b5863 100644 (file)
@@ -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);