greybus: core: disable bundle connections on hot-unplug

Disable bundle connections in core before calling driver disconnect in
case the interface is already gone.

This avoids unnecessary timeouts on hot-unplug when a driver does I/O in
its disconnect callback.

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>
This commit is contained in:
Johan Hovold 2016-01-19 12:51:18 +01:00 committed by Greg Kroah-Hartman
parent 01547770e6
commit 47a2e6769e
1 changed files with 6 additions and 2 deletions

View File

@ -161,8 +161,12 @@ static int greybus_remove(struct device *dev)
struct gb_bundle *bundle = to_gb_bundle(dev);
struct gb_connection *connection;
list_for_each_entry(connection, &bundle->connections, bundle_links)
gb_connection_disable_rx(connection);
list_for_each_entry(connection, &bundle->connections, bundle_links) {
if (bundle->intf->disconnected)
gb_connection_disable(connection);
else
gb_connection_disable_rx(connection);
}
driver->disconnect(bundle);