]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
greybus: connection: add helper for creating offloaded connection
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 11 May 2016 08:17:57 +0000 (10:17 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 13 May 2016 13:30:05 +0000 (15:30 +0200)
Add helper for creating offloaded connection.

This can later be extended to support more elaborate resource
management.

Also fix a minor white space issue.

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

index 9e8828109b1e01cca00f6450d8b6233760c90539..95855d1cad9f53736331b705366a6373116f8f57 100644 (file)
@@ -264,6 +264,19 @@ gb_connection_create_flags(struct gb_bundle *bundle, u16 cport_id,
 }
 EXPORT_SYMBOL_GPL(gb_connection_create_flags);
 
+struct gb_connection *
+gb_connection_create_offloaded(struct gb_bundle *bundle, u16 cport_id,
+                                       unsigned long flags)
+{
+       struct gb_interface *intf = bundle->intf;
+
+       flags |= GB_CONNECTION_FLAG_OFFLOADED;
+
+       return _gb_connection_create(intf->hd, -1, intf, bundle, cport_id,
+                                       NULL, flags);
+}
+EXPORT_SYMBOL_GPL(gb_connection_create_offloaded);
+
 static int gb_connection_hd_cport_enable(struct gb_connection *connection)
 {
        struct gb_host_device *hd = connection->hd;
index c740c3816f0d94e238748844ac34dc6e67032742..a8da9ca214bec2261ea303623d6df85bc42283bd 100644 (file)
@@ -64,9 +64,11 @@ struct gb_connection *gb_connection_create_static(struct gb_host_device *hd,
 struct gb_connection *gb_connection_create_control(struct gb_interface *intf);
 struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
                                u16 cport_id, gb_request_handler_t handler);
-struct gb_connection * gb_connection_create_flags(struct gb_bundle *bundle,
+struct gb_connection *gb_connection_create_flags(struct gb_bundle *bundle,
                                u16 cport_id, gb_request_handler_t handler,
                                unsigned long flags);
+struct gb_connection *gb_connection_create_offloaded(struct gb_bundle *bundle,
+                               u16 cport_id, unsigned long flags);
 void gb_connection_destroy(struct gb_connection *connection);
 
 static inline bool gb_connection_is_static(struct gb_connection *connection)