]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: legacy: use protocol pointer to determine state
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 19 Jan 2016 11:51:17 +0000 (12:51 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 19 Jan 2016 20:17:13 +0000 (12:17 -0800)
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: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/legacy.c

index fd847f42376fe9f13f6c98e85ff6f27a56c1f847..a2c0b9bed9a9c8af3af99031cdb78556b5b3a98b 100644 (file)
@@ -100,7 +100,7 @@ err_unbind_protocol:
 
 static void legacy_connection_exit(struct gb_connection *connection)
 {
-       if (connection->state == GB_CONNECTION_STATE_DISABLED)
+       if (!connection->protocol)
                return;
 
        gb_connection_disable(connection);