]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hwmon: (pmbus/ltc2978) Use detected chip ID to select supported functionality
authorGuenter Roeck <linux@roeck-us.net>
Thu, 21 Feb 2013 18:49:40 +0000 (10:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Mar 2013 18:29:49 +0000 (11:29 -0700)
commit f366fccd0809f13ba20d64cae3c83f7338c88af7 upstream.

We read the chip ID from the chip, use it to determine if the chip ID provided
to the driver is correct, and report it if wrong. We should also use the
correct chip ID to select supported functionality.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/pmbus/ltc2978.c

index cc29a7e57bd731c7a6d4b7d4f9e01a4374da45dd..a58de38e23d821f969a720e9fe03be6aca87752a 100644 (file)
@@ -326,7 +326,7 @@ static int ltc2978_probe(struct i2c_client *client,
        data->temp_max = 0x7c00;
        data->temp2_max = 0x7c00;
 
-       switch (id->driver_data) {
+       switch (data->id) {
        case ltc2978:
                info->read_word_data = ltc2978_read_word_data;
                info->pages = 8;