summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/manifest.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-04-01 20:32:00 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2015-04-06 11:34:39 +0200
commit7c183f70ed5b1fa368559031b1ef2245827f2918 (patch)
treebeb98fc07993f3cdec235b54f61c46f456c9bce1 /drivers/staging/greybus/manifest.c
parent581baacd33b087e4f7322f42ca8f336f7f0acc4d (diff)
greybus: bundle: Create bundles using bundle descriptors
Currently we are creating bundles based on interface descriptors. An interface can have one or more bundles associated with it and so a bundle must be created based on a bundle descriptor. Also get class_type from bundle descriptor. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/manifest.c')
-rw-r--r--drivers/staging/greybus/manifest.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/staging/greybus/manifest.c b/drivers/staging/greybus/manifest.c
index c00e378453df..8541a2a9f0d2 100644
--- a/drivers/staging/greybus/manifest.c
+++ b/drivers/staging/greybus/manifest.c
@@ -108,6 +108,9 @@ static int identify_descriptor(struct gb_interface *intf,
break;
case GREYBUS_TYPE_INTERFACE:
break;
+ case GREYBUS_TYPE_BUNDLE:
+ expected_size += sizeof(struct greybus_descriptor_bundle);
+ break;
case GREYBUS_TYPE_CPORT:
expected_size += sizeof(struct greybus_descriptor_cport);
break;
@@ -237,7 +240,7 @@ static u32 gb_manifest_parse_cports(struct gb_interface *intf,
/*
* Find bundle descriptors in the manifest and set up their data
* structures. Returns the number of bundles set up for the
- * given module.
+ * given interface.
*/
static u32 gb_manifest_parse_bundles(struct gb_interface *intf)
{
@@ -245,13 +248,13 @@ static u32 gb_manifest_parse_bundles(struct gb_interface *intf)
while (true) {
struct manifest_desc *descriptor;
- struct greybus_descriptor_interface *desc_interface;
+ struct greybus_descriptor_bundle *desc_bundle;
struct gb_bundle *bundle;
bool found = false;
/* Find an bundle descriptor */
list_for_each_entry(descriptor, &intf->manifest_descs, links) {
- if (descriptor->type == GREYBUS_TYPE_INTERFACE) {
+ if (descriptor->type == GREYBUS_TYPE_BUNDLE) {
found = true;
break;
}
@@ -260,8 +263,9 @@ static u32 gb_manifest_parse_bundles(struct gb_interface *intf)
break;
/* Found one. Set up its bundle structure*/
- desc_interface = descriptor->data;
- bundle = gb_bundle_create(intf, desc_interface->id);
+ desc_bundle = descriptor->data;
+ bundle = gb_bundle_create(intf, desc_bundle->id,
+ desc_bundle->class_type);
if (!bundle)
return 0; /* Error */