diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-01-19 12:51:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-01-19 12:17:13 -0800 |
commit | 47a2e6769e8194da5570eaed7fc43f5abec18809 (patch) | |
tree | d0993e265f38f6eea83ad74c4cbfe4e5f3a31fb0 /drivers/staging/greybus/core.c | |
parent | greybus: legacy: use protocol pointer to determine state (diff) | |
download | linux-dev-47a2e6769e8194da5570eaed7fc43f5abec18809.tar.xz linux-dev-47a2e6769e8194da5570eaed7fc43f5abec18809.zip |
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.c | 8 |
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); |