diff options
Diffstat (limited to 'drivers/hwmon/pmbus/ucd9200.c')
-rw-r--r-- | drivers/hwmon/pmbus/ucd9200.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/hwmon/pmbus/ucd9200.c b/drivers/hwmon/pmbus/ucd9200.c index ffcc1cf3609..6e1c1a80ab8 100644 --- a/drivers/hwmon/pmbus/ucd9200.c +++ b/drivers/hwmon/pmbus/ucd9200.c @@ -68,13 +68,11 @@ static int ucd9200_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(ucd9200_id); i++) { - mid = &ucd9200_id[i]; + for (mid = ucd9200_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; } @@ -173,13 +171,12 @@ out: static int ucd9200_remove(struct i2c_client *client) { - int ret; const struct pmbus_driver_info *info; info = pmbus_get_driver_info(client); - ret = pmbus_do_remove(client); + pmbus_do_remove(client); kfree(info); - return ret; + return 0; } |