]> git.karo-electronics.de Git - linux-beck.git/commitdiff
greybus: connection: drop the legacy protocol-id parameter
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 21 Jan 2016 16:34:13 +0000 (17:34 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 22 Jan 2016 06:45:09 +0000 (22:45 -0800)
The protocol-id parameter is only used by the legacy driver so remove
it from the generic interface and move it to the legacy driver until it
can be removed completely.

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c
drivers/staging/greybus/connection.h
drivers/staging/greybus/legacy.c

index f81f053a2e98fe7d1810cd933801362624cd4b31..8c7f2eac732372b54f34374dbe43233ff2a4294e 100644 (file)
@@ -118,7 +118,6 @@ static void gb_connection_init_name(struct gb_connection *connection)
  * @intf:              remote interface, or NULL for static connections
  * @bundle:            remote-interface bundle (may be NULL)
  * @cport_id:          remote-interface cport id, or 0 for static connections
- * @protocol_id:       protocol id
  *
  * Create a Greybus connection, representing the bidirectional link
  * between a CPort on a (local) Greybus host device and a CPort on
@@ -135,8 +134,7 @@ static void gb_connection_init_name(struct gb_connection *connection)
 static struct gb_connection *
 gb_connection_create(struct gb_host_device *hd, int hd_cport_id,
                                struct gb_interface *intf,
-                               struct gb_bundle *bundle, int cport_id,
-                               u8 protocol_id)
+                               struct gb_bundle *bundle, int cport_id)
 {
        struct gb_connection *connection;
        struct ida *id_map = &hd->cport_id_map;
@@ -173,8 +171,6 @@ gb_connection_create(struct gb_host_device *hd, int hd_cport_id,
        connection->hd = hd;
        connection->intf = intf;
 
-       connection->protocol_id = protocol_id;
-
        connection->bundle = bundle;
        connection->state = GB_CONNECTION_STATE_DISABLED;
 
@@ -219,22 +215,21 @@ err_unlock:
 struct gb_connection *
 gb_connection_create_static(struct gb_host_device *hd, u16 hd_cport_id)
 {
-       return gb_connection_create(hd, hd_cport_id, NULL, NULL, 0, 0);
+       return gb_connection_create(hd, hd_cport_id, NULL, NULL, 0);
 }
 
 struct gb_connection *
 gb_connection_create_control(struct gb_interface *intf)
 {
-       return gb_connection_create(intf->hd, -1, intf, NULL, 0, 0);
+       return gb_connection_create(intf->hd, -1, intf, NULL, 0);
 }
 
 struct gb_connection *
 gb_connection_create_dynamic(struct gb_interface *intf,
                                        struct gb_bundle *bundle,
-                                       u16 cport_id, u8 protocol_id)
+                                       u16 cport_id)
 {
-       return gb_connection_create(intf->hd, -1, intf, bundle, cport_id,
-                                                               protocol_id);
+       return gb_connection_create(intf->hd, -1, intf, bundle, cport_id);
 }
 EXPORT_SYMBOL_GPL(gb_connection_create_dynamic);
 
index cd4a093f6e9b75f4c863587f4a4be29879014645..442bd49b505234d83453c5b85a83edca20545888 100644 (file)
@@ -59,8 +59,7 @@ 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,
-                               u8 protocol_id);
+                               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)
index 0f3dc8689fb4410f9ad2094a93cd705f0ff145b1..c34764fc30b2a48ff9a33b35128b1844a9741c46 100644 (file)
@@ -155,11 +155,12 @@ static int legacy_probe(struct gb_bundle *bundle,
 
                connection = gb_connection_create_dynamic(bundle->intf,
                                                bundle,
-                                               le16_to_cpu(cport_desc->id),
-                                               cport_desc->protocol_id);
+                                               le16_to_cpu(cport_desc->id));
                if (!connection)
                        goto err_connections_destroy;
 
+               connection->protocol_id = cport_desc->protocol_id;
+
                data->connections[i] = connection;
        }