From 05ad189c23ad278c5586936bbb08147ac6f479be Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Tue, 9 Sep 2014 13:55:03 -0500 Subject: [PATCH] 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 --- drivers/staging/greybus/ap.c | 2 +- drivers/staging/greybus/core.c | 30 +++++++++++----------- drivers/staging/greybus/greybus.h | 4 +-- .../greybus/{greybus_desc.h => greybus_manifest.h} | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) rename drivers/staging/greybus/{greybus_desc.h => greybus_manifest.h} (98%) diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c index a70404d..aee47f5 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 76938cd..107e1fb 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 2b96917..a8d13b5 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 592b651..293451e 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; -- 2.7.4