From: Alex Elder Date: Tue, 9 Sep 2014 18:55:03 +0000 (-0500) Subject: greybus: switch to the term "manifest" X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~2131 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=05ad189c23ad278c5586936bbb08147ac6f479be;p=karo-tx-linux.git greybus: switch to the term "manifest" We agreed to rename a few things to improve clarity. This patch implements one of those changes. The blob of data that describes what's relevant to Greybus within an Ara module will now be called the "module manifest." In addition, in the context of Greybus we'll also be calling what's in an Ara module a "module" or "Greybus module." So this patch renames some structures and updates some comments. It also renames "greybus_desc.h" to be "greybus_manifest.h", and renames greybus_new_device() to be greybus_new_module(). Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c index a70404d7c1f1..aee47f50274d 100644 --- a/drivers/staging/greybus/ap.c +++ b/drivers/staging/greybus/ap.c @@ -17,7 +17,7 @@ #include #include #include "svc_msg.h" -#include "greybus_desc.h" +#include "greybus_manifest.h" #include "greybus.h" struct ap_msg { diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 76938cd00288..107e1fb75b8d 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -344,16 +344,16 @@ static int create_cport(struct greybus_device *gdev, } /** - * greybus_new_device: + * greybus_new_module: * - * Pass in a buffer that _should_ be a set of greybus descriptor fields and spit - * out a greybus device structure. + * Pass in a buffer that _should_ contain a Greybus module manifest + * and spit out a greybus device structure. */ -struct greybus_device *greybus_new_device(struct device *parent, +struct greybus_device *greybus_new_module(struct device *parent, int module_number, u8 *data, int size) { struct greybus_device *gdev; - struct greybus_descriptor_block_header *block; + struct greybus_manifest_header *header; struct greybus_descriptor *desc; int retval; int overall_size; @@ -361,8 +361,8 @@ struct greybus_device *greybus_new_device(struct device *parent, u8 version_major; u8 version_minor; - /* we have to have at _least_ the block header */ - if (size <= sizeof(struct greybus_descriptor_block_header)) + /* we have to have at _least_ the manifest header */ + if (size <= sizeof(struct greybus_manifest_header)) return NULL; gdev = kzalloc(sizeof(*gdev), GFP_KERNEL); @@ -379,21 +379,21 @@ struct greybus_device *greybus_new_device(struct device *parent, device_initialize(&gdev->dev); dev_set_name(&gdev->dev, "%d", module_number); - block = (struct greybus_descriptor_block_header *)data; - overall_size = le16_to_cpu(block->size); + header = (struct greybus_manifest_header *)data; + overall_size = le16_to_cpu(header->size); if (overall_size != size) { - dev_err(parent, "size != block header size, %d != %d\n", size, - overall_size); + dev_err(parent, "size != manifest header size, %d != %d\n", + size, overall_size); goto error; } - version_major = block->version_major; - version_minor = block->version_minor; + version_major = header->version_major; + version_minor = header->version_minor; // FIXME - check version major/minor here! - size -= sizeof(struct greybus_descriptor_block_header); - data += sizeof(struct greybus_descriptor_block_header); + size -= sizeof(struct greybus_manifest_header); + data += sizeof(struct greybus_manifest_header); while (size > 0) { desc = (struct greybus_descriptor *)data; desc_size = le16_to_cpu(desc->header.size); diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 2b96917c8730..a8d13b55de18 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -16,7 +16,7 @@ #include #include #include "greybus_id.h" -#include "greybus_desc.h" +#include "greybus_manifest.h" #define GREYBUS_DEVICE_ID_MATCH_DEVICE \ @@ -209,7 +209,7 @@ void greybus_deregister(struct greybus_driver *driver); int greybus_disabled(void); -struct greybus_device *greybus_new_device(struct device *parent, +struct greybus_device *greybus_new_module(struct device *parent, int module_number, u8 *data, int size); void greybus_remove_device(struct greybus_device *gdev); diff --git a/drivers/staging/greybus/greybus_desc.h b/drivers/staging/greybus/greybus_manifest.h similarity index 98% rename from drivers/staging/greybus/greybus_desc.h rename to drivers/staging/greybus/greybus_manifest.h index 592b6517d43b..293451eee4d9 100644 --- a/drivers/staging/greybus/greybus_desc.h +++ b/drivers/staging/greybus/greybus_manifest.h @@ -12,7 +12,7 @@ #pragma pack(push, 1) -struct greybus_descriptor_block_header { +struct greybus_manifest_header { __le16 size; __u8 version_major; __u8 version_minor;