OSDN Git Service

greybus: endo: Rename endo's 'type' as 'id'
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 28 Apr 2015 14:10:27 +0000 (19:40 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 29 Apr 2015 13:48:32 +0000 (15:48 +0200)
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: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/endo.c
drivers/staging/greybus/endo.h

index b8f6163..b9c7ee6 100644 (file)
@@ -82,14 +82,14 @@ static int create_modules(struct gb_endo *endo)
        u8 *endo_modules;
        int i;
 
-       /* Depending on the endo type, create a bunch of different modules */
-       switch (endo->type) {
+       /* Depending on the endo id, create a bunch of different modules */
+       switch (endo->id) {
        case 0x4755:
                endo_modules = &endo_4755[0];
                break;
        default:
-               dev_err(&endo->dev, "Unknown endo type 0x%04x, aborting!",
-                       endo->type);
+               dev_err(&endo->dev, "Unknown endo id 0x%04x, aborting!",
+                       endo->id);
                return -EINVAL;
        }
 
@@ -118,18 +118,18 @@ struct gb_endo *gb_endo_create(struct greybus_host_device *hd)
        endo->dev.dma_mask = hd->parent->dma_mask;
        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
        // using "fake" numbers.
        strcpy(&endo->svc.serial_number[0], "042");
        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);
        if (retval) {
-               dev_err(hd->parent, "failed to add endo device of type 0x%04x\n",
-                       endo->type);
+               dev_err(hd->parent, "failed to add endo device of id 0x%04x\n",
+                       endo->id);
                put_device(&endo->dev);
                kfree(endo);
                return NULL;
index 649093e..a4342aa 100644 (file)
@@ -18,7 +18,7 @@ struct gb_svc {
 struct gb_endo {
        struct device dev;
        struct gb_svc svc;
-       u16 type;
+       u16 id;
 };
 #define to_gb_endo(d) container_of(d, struct gb_endo, dev)