diff options
Diffstat (limited to 'drivers/hwmon/pmbus/ucd9000.c')
-rw-r--r-- | drivers/hwmon/pmbus/ucd9000.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/hwmon/pmbus/ucd9000.c b/drivers/hwmon/pmbus/ucd9000.c index ace1c731973..4ff6cf289f8 100644 --- a/drivers/hwmon/pmbus/ucd9000.c +++ b/drivers/hwmon/pmbus/ucd9000.c @@ -74,8 +74,8 @@ static int ucd9000_read_byte_data(struct i2c_client *client, int page, int reg) switch (reg) { case PMBUS_FAN_CONFIG_12: - if (page) - return -EINVAL; + if (page > 0) + return -ENXIO; ret = ucd9000_get_fan_config(client, 0); if (ret < 0) @@ -88,8 +88,8 @@ static int ucd9000_read_byte_data(struct i2c_client *client, int page, int reg) ret = fan_config; break; case PMBUS_FAN_CONFIG_34: - if (page) - return -EINVAL; + if (page > 0) + return -ENXIO; ret = ucd9000_get_fan_config(client, 2); if (ret < 0) @@ -141,13 +141,11 @@ static int ucd9000_probe(struct i2c_client *client, block_buffer[ret] = '\0'; dev_info(&client->dev, "Device ID %s\n", block_buffer); - mid = NULL; - for (i = 0; i < ARRAY_SIZE(ucd9000_id); i++) { - mid = &ucd9000_id[i]; + for (mid = ucd9000_id; mid->name[0]; mid++) { if (!strncasecmp(mid->name, block_buffer, strlen(mid->name))) break; } - if (!mid || !strlen(mid->name)) { + if (!mid->name[0]) { dev_err(&client->dev, "Unsupported device\n"); return -ENODEV; } @@ -241,13 +239,12 @@ out: static int ucd9000_remove(struct i2c_client *client) { - int ret; struct ucd9000_data *data; data = to_ucd9000_data(pmbus_get_driver_info(client)); - ret = pmbus_do_remove(client); + pmbus_do_remove(client); kfree(data); - return ret; + return 0; } |