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

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
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment