From: Johan Hovold Date: Tue, 19 Jan 2016 11:51:18 +0000 (+0100) Subject: greybus: core: disable bundle connections on hot-unplug X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~794 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=47a2e6769e8194da5570eaed7fc43f5abec18809;p=karo-tx-linux.git 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 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index a72191f46751..522d0594eebc 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -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);