Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75a60ed2 authored by Perry Hung's avatar Perry Hung Committed by Greg Kroah-Hartman
Browse files

greybus: svc: connection: ask SVC to create connections



Ask the SVC to do all the necessary bits for creating a new connection.
This is skipped for the initial SVC connection.

Tested-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarPerry Hung <perry@leaflabs.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 7e275465
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -251,7 +251,12 @@ gb_connection_create_range(struct greybus_host_device *hd,

	spin_unlock_irq(&gb_connections_lock);

	/* XXX Will have to establish connections to get version */
	if (hd_cport_id != GB_SVC_CPORT_ID) {
		gb_svc_connection_create(hd->svc,
					 hd->endo->ap_intf_id, hd_cport_id,
					 bundle->intf->interface_id, cport_id);
	}

	gb_connection_bind_protocol(connection);
	if (!connection->protocol)
		dev_warn(&connection->dev,
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ struct greybus_host_device {

	struct gb_endo *endo;
	struct gb_connection *initial_svc_connection;
	struct gb_svc *svc;

	/* Private data for the host driver */
	unsigned long hd_priv[0] __aligned(sizeof(s64));
+2 −0
Original line number Diff line number Diff line
@@ -430,6 +430,7 @@ static int gb_svc_connection_init(struct gb_connection *connection)
	if (!svc)
		return -ENOMEM;

	connection->hd->svc = svc;
	svc->connection = connection;
	connection->private = svc;

@@ -445,6 +446,7 @@ static void gb_svc_connection_exit(struct gb_connection *connection)
{
	struct gb_svc *svc = connection->private;

	connection->hd->svc = NULL;
	connection->private = NULL;
	kfree(svc);
}