From: Johan Hovold Date: Tue, 19 Jan 2016 11:51:17 +0000 (+0100) Subject: greybus: legacy: use protocol pointer to determine state X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~795 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=01547770e6fc283ce74944415fc069d287de082a;p=karo-tx-linux.git 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: Viresh Kumar Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/legacy.c b/drivers/staging/greybus/legacy.c index fd847f42376f..a2c0b9bed9a9 100644 --- a/drivers/staging/greybus/legacy.c +++ b/drivers/staging/greybus/legacy.c @@ -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);