]> git.hungrycats.org Git - linux/commitdiff
[PATCH] I2C: sysfs sensor nameing inconsistency
authorAndrey Borzenkov <arvidjaar@mail.ru>
Mon, 22 Sep 2003 08:24:36 +0000 (01:24 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 22 Sep 2003 08:24:36 +0000 (01:24 -0700)
> That's what you are going to have to set the name file to in the
> i2c_client structure, much like your patch did.  Then look at the
> different name files in each device directory to see what kind of device
> it is (chip, subclient, etc.)

OK attached patch sets all names to just chip name for chips themselves and
"chipname subclient" when subclient ios registered.

drivers/i2c/chips/adm1021.c
drivers/i2c/chips/it87.c
drivers/i2c/chips/lm78.c
drivers/i2c/chips/lm85.c
drivers/i2c/chips/via686a.c
drivers/i2c/chips/w83781d.c

index a7e02cacd894fb912bfc6b69735262b965a44b81..04af7a6eeaf7d75a3b24b482d9f69e2bd1ab8cd5 100644 (file)
@@ -225,7 +225,6 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind)
        struct adm1021_data *data;
        int err = 0;
        const char *type_name = "";
-       const char *client_name = "";
 
        /* Make sure we aren't probing the ISA bus!! This is just a safety check
           at this moment; i2c_detect really won't call us. */
@@ -291,28 +290,20 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind)
 
        if (kind == max1617) {
                type_name = "max1617";
-               client_name = "MAX1617 chip";
        } else if (kind == max1617a) {
                type_name = "max1617a";
-               client_name = "MAX1617A chip";
        } else if (kind == adm1021) {
                type_name = "adm1021";
-               client_name = "ADM1021 chip";
        } else if (kind == adm1023) {
                type_name = "adm1023";
-               client_name = "ADM1023 chip";
        } else if (kind == thmc10) {
                type_name = "thmc10";
-               client_name = "THMC10 chip";
        } else if (kind == lm84) {
                type_name = "lm84";
-               client_name = "LM84 chip";
        } else if (kind == gl523sm) {
                type_name = "gl523sm";
-               client_name = "GL523SM chip";
        } else if (kind == mc1066) {
                type_name = "mc1066";
-               client_name = "MC1066 chip";
        } else {
                dev_err(&adapter->dev, "Internal error: unknown kind (%d)?!?",
                        kind);
@@ -320,7 +311,7 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind)
        }
 
        /* Fill in the remaining client fields and put it into the global list */
-       strlcpy(new_client->name, client_name, I2C_NAME_SIZE);
+       strlcpy(new_client->name, type_name, I2C_NAME_SIZE);
        data->type = kind;
 
        new_client->id = adm1021_id++;
index 89b50d805bc9afc8ffdcf252d6c25c44c6d56b71..6cc3ca16f8f41daa7ca2db4ffb958502abe53b6e 100644 (file)
@@ -592,7 +592,6 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind)
        struct it87_data *data;
        int err = 0;
        const char *name = "";
-       const char *client_name = "";
        int is_isa = i2c_is_isa_adapter(adapter);
 
        if (!is_isa && 
@@ -681,10 +680,8 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind)
 
        if (kind == it87) {
                name = "it87";
-               client_name = "IT87 chip";
        } /* else if (kind == it8712) {
                name = "it8712";
-               client_name = "IT87-J chip";
        } */ else {
                dev_dbg(&adapter->dev, "Internal error: unknown kind (%d)?!?",
                        kind);
index ad13af2ebc0bd14e60301699320632f2ba6f66d3..5fa679b4bee6666456dc79861971d47e49104852 100644 (file)
@@ -625,11 +625,11 @@ int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
        }
 
        if (kind == lm78) {
-               client_name = "LM78 chip";
+               client_name = "lm78";
        } else if (kind == lm78j) {
-               client_name = "LM78-J chip";
+               client_name = "lm78-j";
        } else if (kind == lm79) {
-               client_name = "LM79 chip";
+               client_name = "lm79";
        } else {
                dev_dbg(&adapter->dev, "Internal error: unknown kind (%d)?!?",
                        kind);
index 769c71c910c09b89ab83f718bb9a71c5780309a6..3b66568454a113a6c8893de02083ef27f0b27d73 100644 (file)
@@ -853,24 +853,20 @@ int lm85_detect(struct i2c_adapter *adapter, int address,
        /* Fill in the chip specific driver values */
        if ( kind == any_chip ) {
                type_name = "lm85";
-               strlcpy(new_client->name, "Generic LM85", I2C_NAME_SIZE);
        } else if ( kind == lm85b ) {
                type_name = "lm85b";
-               strlcpy(new_client->name, "National LM85-B", I2C_NAME_SIZE);
        } else if ( kind == lm85c ) {
                type_name = "lm85c";
-               strlcpy(new_client->name, "National LM85-C", I2C_NAME_SIZE);
        } else if ( kind == adm1027 ) {
                type_name = "adm1027";
-               strlcpy(new_client->name, "Analog Devices ADM1027", I2C_NAME_SIZE);
        } else if ( kind == adt7463 ) {
                type_name = "adt7463";
-               strlcpy(new_client->name, "Analog Devices ADT7463", I2C_NAME_SIZE);
        } else {
                dev_dbg(&adapter->dev, "Internal error, invalid kind (%d)!", kind);
                err = -EFAULT ;
                goto ERROR1;
        }
+       strlcpy(new_client->name, type_name, I2C_NAME_SIZE);
 
        /* Fill in the remaining client fields */
        new_client->id = lm85_id++;
index cbd11d1acfae9aefa121cfc487818510f0588996..88e9d918bd09542a68ec5315827d91ed487156f7 100644 (file)
@@ -671,7 +671,7 @@ static int via686a_detect(struct i2c_adapter *adapter, int address, int kind)
        struct i2c_client *new_client;
        struct via686a_data *data;
        int err = 0;
-       const char client_name[] = "via686a chip";
+       const char client_name[] = "via686a";
        u16 val;
 
        /* Make sure we are probing the ISA bus!!  */
index c6db6126af38237ad8d065668aab5f608d454e4b..450e0067c041c752a8556d5439cf93d56dbd6e58 100644 (file)
@@ -1098,15 +1098,15 @@ w83781d_detect_subclients(struct i2c_adapter *adapter, int address, int kind,
        }
 
        if (kind == w83781d)
-               client_name = "W83781D subclient";
+               client_name = "w83781d subclient";
        else if (kind == w83782d)
-               client_name = "W83782D subclient";
+               client_name = "w83782d subclient";
        else if (kind == w83783s)
-               client_name = "W83783S subclient";
+               client_name = "w83783s subclient";
        else if (kind == w83627hf)
-               client_name = "W83627HF subclient";
+               client_name = "w83627hf subclient";
        else if (kind == as99127f)
-               client_name = "AS99127F subclient";
+               client_name = "as99127f subclient";
        else
                client_name = "unknown subclient?";
 
@@ -1304,20 +1304,20 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
        }
 
        if (kind == w83781d) {
-               client_name = "W83781D chip";
+               client_name = "w83781d";
        } else if (kind == w83782d) {
-               client_name = "W83782D chip";
+               client_name = "w83782d";
        } else if (kind == w83783s) {
-               client_name = "W83783S chip";
+               client_name = "w83783s";
        } else if (kind == w83627hf) {
                if (val1 == 0x90)
-                       client_name = "W83627THF chip";
+                       client_name = "w83627thf";
                else
-                       client_name = "W83627HF chip";
+                       client_name = "w83627hf";
        } else if (kind == as99127f) {
-               client_name = "AS99127F chip";
+               client_name = "as99127f";
        } else if (kind == w83697hf) {
-               client_name = "W83697HF chip";
+               client_name = "w83697hf";
        } else {
                dev_err(&new_client->dev, "Internal error: unknown "
                                                "kind (%d)?!?", kind);