]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
greybus: connection: simplify connection-creation interface
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 21 Jan 2016 16:34:14 +0000 (17:34 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 22 Jan 2016 06:45:09 +0000 (22:45 -0800)
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 <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 8c7f2eac732372b54f34374dbe43233ff2a4294e..227bfe8ba34122780d17e15a6c1df64954a6103a 100644 (file)
@@ -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);
index 442bd49b505234d83453c5b85a83edca20545888..863109cb4180b83cad9e667299ed9510f80cc8ad 100644 (file)
@@ -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)
index c34764fc30b2a48ff9a33b35128b1844a9741c46..86ab7b7141ec389590c980c6c7d47cf4594da713 100644 (file)
@@ -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;