summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/bundle.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-01-21 17:34:09 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-21 22:45:09 -0800
commit98fdf5a037f0789f1ea6e22431a4a4cc7c41829d (patch)
tree8d7cb053d2dfdce35334440311b53d5edf755d77 /drivers/staging/greybus/bundle.c
parent6ce4cc278deca9849bd54783294be7edbe24bac0 (diff)
downloadop-kernel-dev-98fdf5a037f0789f1ea6e22431a4a4cc7c41829d.zip
op-kernel-dev-98fdf5a037f0789f1ea6e22431a4a4cc7c41829d.tar.gz
greybus: core: defer connection creation to driver probe
Defer connection creation to bundle driver probe instead of creating them when initialising the interface and parsing the manifest. Store copies of the CPorts descriptors in the bundle for the drivers to use, and update the legacy driver. This is needed for drivers that need more control over host-device resource management, for example, when a protocol needs to use a dedicated host CPort for traffic offloading (e.g. camera data). This also avoids allocating host CPorts for bundles that are not bound to a driver or for remote CPorts that a driver does not need. 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/bundle.c')
-rw-r--r--drivers/staging/greybus/bundle.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
index ec52bde..1714482 100644
--- a/drivers/staging/greybus/bundle.c
+++ b/drivers/staging/greybus/bundle.c
@@ -81,15 +81,9 @@ 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->cport_desc);
kfree(bundle);
}
OpenPOWER on IntegriCloud