Commit 8f8b2297 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: endo: Rename endo's 'type' as 'id'

There can be three Endo types: mini, medium and large. And that's what
Endo 'type' should refer to.

But we have named the 16 bit number that uniquely represents a valid
endo, as its type. 'id' seems to be a more suitable name to that instead
of 'type'. Lets rename it.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 58d67465
...@@ -82,14 +82,14 @@ static int create_modules(struct gb_endo *endo) ...@@ -82,14 +82,14 @@ static int create_modules(struct gb_endo *endo)
u8 *endo_modules; u8 *endo_modules;
int i; int i;
/* Depending on the endo type, create a bunch of different modules */ /* Depending on the endo id, create a bunch of different modules */
switch (endo->type) { switch (endo->id) {
case 0x4755: case 0x4755:
endo_modules = &endo_4755[0]; endo_modules = &endo_4755[0];
break; break;
default: default:
dev_err(&endo->dev, "Unknown endo type 0x%04x, aborting!", dev_err(&endo->dev, "Unknown endo id 0x%04x, aborting!",
endo->type); endo->id);
return -EINVAL; return -EINVAL;
} }
...@@ -118,18 +118,18 @@ struct gb_endo *gb_endo_create(struct greybus_host_device *hd) ...@@ -118,18 +118,18 @@ struct gb_endo *gb_endo_create(struct greybus_host_device *hd)
endo->dev.dma_mask = hd->parent->dma_mask; endo->dev.dma_mask = hd->parent->dma_mask;
device_initialize(&endo->dev); device_initialize(&endo->dev);
// FIXME - determine endo "type" from the SVC // FIXME - determine endo "id" from the SVC
// Also get the version and serial number from the SVC, right now we are // Also get the version and serial number from the SVC, right now we are
// using "fake" numbers. // using "fake" numbers.
strcpy(&endo->svc.serial_number[0], "042"); strcpy(&endo->svc.serial_number[0], "042");
strcpy(&endo->svc.version[0], "0.0"); strcpy(&endo->svc.version[0], "0.0");
endo->type = 0x4755; endo->id = 0x4755;
dev_set_name(&endo->dev, "endo-0x%04x", endo->type); dev_set_name(&endo->dev, "endo-0x%04x", endo->id);
retval = device_add(&endo->dev); retval = device_add(&endo->dev);
if (retval) { if (retval) {
dev_err(hd->parent, "failed to add endo device of type 0x%04x\n", dev_err(hd->parent, "failed to add endo device of id 0x%04x\n",
endo->type); endo->id);
put_device(&endo->dev); put_device(&endo->dev);
kfree(endo); kfree(endo);
return NULL; return NULL;
......
...@@ -18,7 +18,7 @@ struct gb_svc { ...@@ -18,7 +18,7 @@ struct gb_svc {
struct gb_endo { struct gb_endo {
struct device dev; struct device dev;
struct gb_svc svc; struct gb_svc svc;
u16 type; u16 id;
}; };
#define to_gb_endo(d) container_of(d, struct gb_endo, dev) #define to_gb_endo(d) container_of(d, struct gb_endo, dev)
......
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