greybus: interface: fix hot-unplug control-connection timeouts

Set an interface disconnected flag when the interface has been
hot-unplugged (e.g. forcibly removed or after a reboot), and use it to
disable the control connection early when deregistering the interface
and its bundles.

This avoids a one-second (default) timeout for every enabled connection
(e.g. one per bundle) at hot-unplug, something which for the default
gpbridge manifest currently amounts to five seconds.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c
index aa30dc2..ecc64be 100644
--- a/drivers/staging/greybus/interface.c
+++ b/drivers/staging/greybus/interface.c
@@ -130,6 +130,9 @@
 	struct gb_bundle *bundle;
 	struct gb_bundle *next;
 
+	if (intf->disconnected)
+		gb_control_disable(intf->control);
+
 	list_for_each_entry_safe(bundle, next, &intf->bundles, links)
 		gb_bundle_destroy(bundle);