From: Matt Porter Date: Sat, 27 Sep 2014 01:49:48 +0000 (-0500) Subject: greybus: update descriptor module_id->module to match spec X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d63ff7a2d40b8865eb00857cdb910944c17f0b2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: update descriptor module_id->module to match spec Greybus spec was updated to change the name of the Module ID descriptor to simply Module descriptor. Change everything accordingly. Signed-off-by: Matt Porter Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 33d7a334c9b1..37bc7803db91 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -33,18 +33,18 @@ EXPORT_SYMBOL_GPL(greybus_disabled); static int greybus_match_one_id(struct greybus_module *gmod, const struct greybus_module_id *id) { - struct greybus_descriptor_module_id *module_id; + struct greybus_descriptor_module *module; struct greybus_descriptor_serial_number *serial_num; - module_id = &gmod->module_id; + module = &gmod->module; serial_num = &gmod->serial_number; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_VENDOR) && - (id->vendor != le16_to_cpu(module_id->vendor))) + (id->vendor != le16_to_cpu(module->vendor))) return 0; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_PRODUCT) && - (id->product != le16_to_cpu(module_id->product))) + (id->product != le16_to_cpu(module->product))) return 0; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_SERIAL) && @@ -249,16 +249,16 @@ static int create_function(struct greybus_module *gmod, return 0; } -static int create_module_id(struct greybus_module *gmod, - struct greybus_descriptor_module_id *module_id, +static int create_module(struct greybus_module *gmod, + struct greybus_descriptor_module *module, size_t desc_size) { - if (desc_size != sizeof(*module_id)) { + if (desc_size != sizeof(*module)) { dev_err(gmod->dev.parent, "invalid module header size %zu\n", desc_size); return -EINVAL; } - memcpy(&gmod->module_id, module_id, desc_size); + memcpy(&gmod->module, module, desc_size); return 0; } @@ -422,8 +422,8 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id, data_size); break; - case GREYBUS_TYPE_MODULE_ID: - retval = create_module_id(gmod, &desc->module_id, + case GREYBUS_TYPE_MODULE: + retval = create_module(gmod, &desc->module, data_size); break; diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 692a5b9bf797..0a0b0a591355 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -200,7 +200,7 @@ struct greybus_module { struct device dev; u16 module_number; struct greybus_descriptor_function function; - struct greybus_descriptor_module_id module_id; + struct greybus_descriptor_module module; struct greybus_descriptor_serial_number serial_number; int num_cports; int num_strings; diff --git a/drivers/staging/greybus/greybus_manifest.h b/drivers/staging/greybus/greybus_manifest.h index 8b4acd3c2fc1..037d7a4fd8f2 100644 --- a/drivers/staging/greybus/greybus_manifest.h +++ b/drivers/staging/greybus/greybus_manifest.h @@ -21,7 +21,7 @@ struct greybus_manifest_header { enum greybus_descriptor_type { GREYBUS_TYPE_INVALID = 0x0000, GREYBUS_TYPE_FUNCTION = 0x0001, - GREYBUS_TYPE_MODULE_ID = 0x0002, + GREYBUS_TYPE_MODULE = 0x0002, GREYBUS_TYPE_SERIAL_NUMBER = 0x0003, GREYBUS_TYPE_STRING = 0x0004, GREYBUS_TYPE_CPORT = 0x0005, @@ -58,7 +58,7 @@ struct greybus_descriptor_function { __u8 reserved; }; -struct greybus_descriptor_module_id { +struct greybus_descriptor_module { __le16 vendor; __le16 product; __le16 version; @@ -87,7 +87,7 @@ struct greybus_descriptor { struct greybus_descriptor_header header; union { struct greybus_descriptor_function function; - struct greybus_descriptor_module_id module_id; + struct greybus_descriptor_module module; struct greybus_descriptor_serial_number serial_number; struct greybus_descriptor_string string; struct greybus_descriptor_cport cport; diff --git a/drivers/staging/greybus/sysfs.c b/drivers/staging/greybus/sysfs.c index 792a2381c289..8cedd4b0e468 100644 --- a/drivers/staging/greybus/sysfs.c +++ b/drivers/staging/greybus/sysfs.c @@ -74,7 +74,7 @@ static ssize_t module_##field##_show(struct device *dev, \ char *buf) \ { \ struct greybus_module *gmod = to_greybus_module(dev); \ - return sprintf(buf, "%x\n", gmod->module_id.field); \ + return sprintf(buf, "%x\n", gmod->module.field); \ } \ static DEVICE_ATTR_RO(module_##field) @@ -89,7 +89,7 @@ static ssize_t module_vendor_string_show(struct device *dev, struct greybus_module *gmod = to_greybus_module(dev); return sprintf(buf, "%s", - greybus_string(gmod, gmod->module_id.vendor_stringid)); + greybus_string(gmod, gmod->module.vendor_stringid)); } static DEVICE_ATTR_RO(module_vendor_string); @@ -100,7 +100,7 @@ static ssize_t module_product_string_show(struct device *dev, struct greybus_module *gmod = to_greybus_module(dev); return sprintf(buf, "%s", - greybus_string(gmod, gmod->module_id.product_stringid)); + greybus_string(gmod, gmod->module.product_stringid)); } static DEVICE_ATTR_RO(module_product_string); @@ -119,17 +119,17 @@ static umode_t module_attrs_are_visible(struct kobject *kobj, struct greybus_module *gmod = to_greybus_module(kobj_to_dev(kobj)); if ((a == &dev_attr_module_vendor_string.attr) && - (gmod->module_id.vendor_stringid)) + (gmod->module.vendor_stringid)) return a->mode; if ((a == &dev_attr_module_product_string.attr) && - (gmod->module_id.product_stringid)) + (gmod->module.product_stringid)) return a->mode; // FIXME - make this a dynamic structure to "know" if it really is here // or not easier? - if (gmod->module_id.vendor || - gmod->module_id.product || - gmod->module_id.version) + if (gmod->module.vendor || + gmod->module.product || + gmod->module.version) return a->mode; return 0; }