summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/core.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-01-19 12:51:18 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-19 12:17:13 -0800
commit47a2e6769e8194da5570eaed7fc43f5abec18809 (patch)
treed0993e265f38f6eea83ad74c4cbfe4e5f3a31fb0 /drivers/staging/greybus/core.c
parent01547770e6fc283ce74944415fc069d287de082a (diff)
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>
Diffstat (limited to 'drivers/staging/greybus/core.c')
-rw-r--r--drivers/staging/greybus/core.c8
1 files changed, 6 insertions, 2 deletions
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);