Commit 6d63ff7a authored by Matt Porter's avatar Matt Porter Committed by Greg Kroah-Hartman

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: default avatarMatt Porter <mporter@linaro.org>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent dce745af
...@@ -33,18 +33,18 @@ EXPORT_SYMBOL_GPL(greybus_disabled); ...@@ -33,18 +33,18 @@ EXPORT_SYMBOL_GPL(greybus_disabled);
static int greybus_match_one_id(struct greybus_module *gmod, static int greybus_match_one_id(struct greybus_module *gmod,
const struct greybus_module_id *id) 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; struct greybus_descriptor_serial_number *serial_num;
module_id = &gmod->module_id; module = &gmod->module;
serial_num = &gmod->serial_number; serial_num = &gmod->serial_number;
if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_VENDOR) && 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; return 0;
if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_PRODUCT) && 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; return 0;
if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_SERIAL) && if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_SERIAL) &&
...@@ -249,16 +249,16 @@ static int create_function(struct greybus_module *gmod, ...@@ -249,16 +249,16 @@ static int create_function(struct greybus_module *gmod,
return 0; return 0;
} }
static int create_module_id(struct greybus_module *gmod, static int create_module(struct greybus_module *gmod,
struct greybus_descriptor_module_id *module_id, struct greybus_descriptor_module *module,
size_t desc_size) 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", dev_err(gmod->dev.parent, "invalid module header size %zu\n",
desc_size); desc_size);
return -EINVAL; return -EINVAL;
} }
memcpy(&gmod->module_id, module_id, desc_size); memcpy(&gmod->module, module, desc_size);
return 0; return 0;
} }
...@@ -422,8 +422,8 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id, ...@@ -422,8 +422,8 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id,
data_size); data_size);
break; break;
case GREYBUS_TYPE_MODULE_ID: case GREYBUS_TYPE_MODULE:
retval = create_module_id(gmod, &desc->module_id, retval = create_module(gmod, &desc->module,
data_size); data_size);
break; break;
......
...@@ -200,7 +200,7 @@ struct greybus_module { ...@@ -200,7 +200,7 @@ struct greybus_module {
struct device dev; struct device dev;
u16 module_number; u16 module_number;
struct greybus_descriptor_function function; 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_serial_number serial_number;
int num_cports; int num_cports;
int num_strings; int num_strings;
......
...@@ -21,7 +21,7 @@ struct greybus_manifest_header { ...@@ -21,7 +21,7 @@ struct greybus_manifest_header {
enum greybus_descriptor_type { enum greybus_descriptor_type {
GREYBUS_TYPE_INVALID = 0x0000, GREYBUS_TYPE_INVALID = 0x0000,
GREYBUS_TYPE_FUNCTION = 0x0001, GREYBUS_TYPE_FUNCTION = 0x0001,
GREYBUS_TYPE_MODULE_ID = 0x0002, GREYBUS_TYPE_MODULE = 0x0002,
GREYBUS_TYPE_SERIAL_NUMBER = 0x0003, GREYBUS_TYPE_SERIAL_NUMBER = 0x0003,
GREYBUS_TYPE_STRING = 0x0004, GREYBUS_TYPE_STRING = 0x0004,
GREYBUS_TYPE_CPORT = 0x0005, GREYBUS_TYPE_CPORT = 0x0005,
...@@ -58,7 +58,7 @@ struct greybus_descriptor_function { ...@@ -58,7 +58,7 @@ struct greybus_descriptor_function {
__u8 reserved; __u8 reserved;
}; };
struct greybus_descriptor_module_id { struct greybus_descriptor_module {
__le16 vendor; __le16 vendor;
__le16 product; __le16 product;
__le16 version; __le16 version;
...@@ -87,7 +87,7 @@ struct greybus_descriptor { ...@@ -87,7 +87,7 @@ struct greybus_descriptor {
struct greybus_descriptor_header header; struct greybus_descriptor_header header;
union { union {
struct greybus_descriptor_function function; 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_serial_number serial_number;
struct greybus_descriptor_string string; struct greybus_descriptor_string string;
struct greybus_descriptor_cport cport; struct greybus_descriptor_cport cport;
......
...@@ -74,7 +74,7 @@ static ssize_t module_##field##_show(struct device *dev, \ ...@@ -74,7 +74,7 @@ static ssize_t module_##field##_show(struct device *dev, \
char *buf) \ char *buf) \
{ \ { \
struct greybus_module *gmod = to_greybus_module(dev); \ 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) static DEVICE_ATTR_RO(module_##field)
...@@ -89,7 +89,7 @@ static ssize_t module_vendor_string_show(struct device *dev, ...@@ -89,7 +89,7 @@ static ssize_t module_vendor_string_show(struct device *dev,
struct greybus_module *gmod = to_greybus_module(dev); struct greybus_module *gmod = to_greybus_module(dev);
return sprintf(buf, "%s", 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); static DEVICE_ATTR_RO(module_vendor_string);
...@@ -100,7 +100,7 @@ static ssize_t module_product_string_show(struct device *dev, ...@@ -100,7 +100,7 @@ static ssize_t module_product_string_show(struct device *dev,
struct greybus_module *gmod = to_greybus_module(dev); struct greybus_module *gmod = to_greybus_module(dev);
return sprintf(buf, "%s", 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); static DEVICE_ATTR_RO(module_product_string);
...@@ -119,17 +119,17 @@ static umode_t module_attrs_are_visible(struct kobject *kobj, ...@@ -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)); struct greybus_module *gmod = to_greybus_module(kobj_to_dev(kobj));
if ((a == &dev_attr_module_vendor_string.attr) && if ((a == &dev_attr_module_vendor_string.attr) &&
(gmod->module_id.vendor_stringid)) (gmod->module.vendor_stringid))
return a->mode; return a->mode;
if ((a == &dev_attr_module_product_string.attr) && if ((a == &dev_attr_module_product_string.attr) &&
(gmod->module_id.product_stringid)) (gmod->module.product_stringid))
return a->mode; return a->mode;
// FIXME - make this a dynamic structure to "know" if it really is here // FIXME - make this a dynamic structure to "know" if it really is here
// or not easier? // or not easier?
if (gmod->module_id.vendor || if (gmod->module.vendor ||
gmod->module_id.product || gmod->module.product ||
gmod->module_id.version) gmod->module.version)
return a->mode; return a->mode;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment