hwmon: Clean up detect functions
As kind is now hard-coded to -1, there is room for code clean-ups. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Riku Voipio <riku.voipio@iki.fi> Acked-by: "Hans J. Koch" <hjk@linutronix.de> Cc: Rudolf Marek <r.marek@assembler.cz>
This commit is contained in:
@ -691,13 +691,11 @@ static int gl520_detect(struct i2c_client *client, int kind,
|
||||
return -ENODEV;
|
||||
|
||||
/* Determine the chip type. */
|
||||
if (kind < 0) {
|
||||
if ((gl520_read_value(client, GL520_REG_CHIP_ID) != 0x20) ||
|
||||
((gl520_read_value(client, GL520_REG_REVISION) & 0x7f) != 0x00) ||
|
||||
((gl520_read_value(client, GL520_REG_CONF) & 0x80) != 0x00)) {
|
||||
dev_dbg(&client->dev, "Unknown chip type, skipping\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
if ((gl520_read_value(client, GL520_REG_CHIP_ID) != 0x20) ||
|
||||
((gl520_read_value(client, GL520_REG_REVISION) & 0x7f) != 0x00) ||
|
||||
((gl520_read_value(client, GL520_REG_CONF) & 0x80) != 0x00)) {
|
||||
dev_dbg(&client->dev, "Unknown chip type, skipping\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
strlcpy(info->type, "gl520sm", I2C_NAME_SIZE);
|
||||
|
Reference in New Issue
Block a user