diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-01-19 12:51:09 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-01-19 12:17:13 -0800 |
commit | fa8369c130098da3276bafec425822aa74971905 (patch) | |
tree | a19da4eba81093b11fbc073da3bd113506850e5e | |
parent | beb6b7fede005ae351619b30a8940a04e797b9b2 (diff) |
greybus: core: disable incoming operations pre disconnect
Disable and flush incoming operations before calling driver disconnect.
Bundle drivers are still responsible for disabling their connections
in their disconnect callback.
Note that specifically the legacy protocols must have incoming
operations disabled when their connection_exit callback is called as
that is where their state is deallocated.
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>
-rw-r--r-- | drivers/staging/greybus/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 28f48d79b005..cf06c9fb5bdc 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -159,6 +159,10 @@ static int greybus_remove(struct device *dev) { struct greybus_driver *driver = to_greybus_driver(dev->driver); 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); driver->disconnect(bundle); return 0; |