greybus: update string descriptor length field to __u8 type to match spec
authorMatt Porter <mporter@linaro.org>
Sat, 27 Sep 2014 01:49:51 +0000 (20:49 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 30 Sep 2014 00:57:33 +0000 (17:57 -0700)
Greybus spec was updated to make the length field a single byte. Update
the type and remove endian handling of that field in the core.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/core.c
drivers/staging/greybus/greybus_manifest.h

index fc54ac9..05217c6 100644 (file)
@@ -279,7 +279,7 @@ static int create_string(struct greybus_module *gmod,
                return -EINVAL;
        }
 
-       string_size = le16_to_cpu(string->length);
+       string_size = string->length;
        gmod_string = kzalloc(sizeof(*gmod_string) + string_size + 1, GFP_KERNEL);
        if (!gmod_string)
                return -ENOMEM;
index 2830d55..8ffeb17 100644 (file)
@@ -63,7 +63,7 @@ struct greybus_descriptor_module {
 };
 
 struct greybus_descriptor_string {
-       __le16  length;
+       __u8    length;
        __u8    id;
        __u8    string[0];
 };