summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2015-12-07 15:05:42 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2015-12-08 15:56:38 -0500
commitbdc37354aa933d299c959144487eba777e707b63 (patch)
tree2de1492b930bfcd0f0fa8f80668342d3da35c55f /drivers
parenta234792d715345ebcd684196b05ef0f7454a64cb (diff)
greybus: bundle: separate connection disabling and destruction
Separate bundle-connection disabling and destruction, and destroy the connections along with the bundle. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/greybus/bundle.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
index 5d058a947413..0f3a00d8d4f2 100644
--- a/drivers/staging/greybus/bundle.c
+++ b/drivers/staging/greybus/bundle.c
@@ -81,6 +81,13 @@ static struct gb_bundle *gb_bundle_find(struct gb_interface *intf,
static void gb_bundle_release(struct device *dev)
{
struct gb_bundle *bundle = to_gb_bundle(dev);
+ struct gb_connection *connection;
+ struct gb_connection *tmp;
+
+ list_for_each_entry_safe(connection, tmp, &bundle->connections,
+ bundle_links) {
+ gb_connection_destroy(connection);
+ }
kfree(bundle->state);
kfree(bundle);
@@ -145,11 +152,9 @@ struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
static void gb_bundle_connections_exit(struct gb_bundle *bundle)
{
struct gb_connection *connection;
- struct gb_connection *next;
- list_for_each_entry_safe(connection, next, &bundle->connections,
- bundle_links)
- gb_connection_destroy(connection);
+ list_for_each_entry(connection, &bundle->connections, bundle_links)
+ gb_connection_exit(connection);
}
/*