Commit 285dde44 authored by Andrey Borzenkov's avatar Andrey Borzenkov Committed by Greg Kroah-Hartman

[PATCH] I2C: sysfs sensor nameing inconsistency

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