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>
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);