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

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: 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 01547770
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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)
	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);