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

greybus: legacy: use protocol pointer to determine state



Use the protocol pointer to determine the legacy connection state.

This is needed to allow core disable connections when an interface has
been hot-unplugged without the legacy protocols leaking its resources.

Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 50dfb878
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ static int legacy_connection_init(struct gb_connection *connection)

static void legacy_connection_exit(struct gb_connection *connection)
{
	if (connection->state == GB_CONNECTION_STATE_DISABLED)
	if (!connection->protocol)
		return;

	gb_connection_disable(connection);