Commit 781ac866 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

greybus: connection: add helper for creating offloaded connection



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: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent ca1f8f80
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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;
+3 −1
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ struct gb_connection *gb_connection_create(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)