]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i8k: Drop all labels
authorGuenter Roeck <linux@roeck-us.net>
Sat, 21 Jun 2014 15:08:09 +0000 (08:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 23:41:36 +0000 (16:41 -0700)
Labels are known to be wrong for several Dell laptops.
For example, a single fan may be shown as right fan when in reality
it sits on the left side of the chassis. Drop all labels to avoid
such inaccuracies. Users can select labels in the sensors configuration
file instead if desired.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Andreas Mohr <andi@lisas.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/i8k.c

index d915707d2ba1d3eae5b3ade411dd5226a5f3296d..3dc1a724ecc2e586865958e58fd984a33f0583aa 100644 (file)
@@ -542,20 +542,6 @@ static ssize_t i8k_hwmon_set_pwm(struct device *dev,
        return err < 0 ? -EIO : count;
 }
 
-static ssize_t i8k_hwmon_show_label(struct device *dev,
-                                   struct device_attribute *devattr,
-                                   char *buf)
-{
-       static const char *labels[3] = {
-               "CPU",
-               "Left Fan",
-               "Right Fan",
-       };
-       int index = to_sensor_dev_attr(devattr)->index;
-
-       return sprintf(buf, "%s\n", labels[index]);
-}
-
 static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, i8k_hwmon_show_temp, NULL, 0);
 static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, i8k_hwmon_show_temp, NULL, 1);
 static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, i8k_hwmon_show_temp, NULL, 2);
@@ -568,41 +554,34 @@ static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, i8k_hwmon_show_fan, NULL,
                          I8K_FAN_RIGHT);
 static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, i8k_hwmon_show_pwm,
                          i8k_hwmon_set_pwm, I8K_FAN_RIGHT);
-static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, i8k_hwmon_show_label, NULL, 0);
-static SENSOR_DEVICE_ATTR(fan1_label, S_IRUGO, i8k_hwmon_show_label, NULL, 1);
-static SENSOR_DEVICE_ATTR(fan2_label, S_IRUGO, i8k_hwmon_show_label, NULL, 2);
 
 static struct attribute *i8k_attrs[] = {
        &sensor_dev_attr_temp1_input.dev_attr.attr,     /* 0 */
-       &sensor_dev_attr_temp1_label.dev_attr.attr,     /* 1 */
-       &sensor_dev_attr_temp2_input.dev_attr.attr,     /* 2 */
-       &sensor_dev_attr_temp3_input.dev_attr.attr,     /* 3 */
-       &sensor_dev_attr_temp4_input.dev_attr.attr,     /* 4 */
-       &sensor_dev_attr_fan1_input.dev_attr.attr,      /* 5 */
-       &sensor_dev_attr_pwm1.dev_attr.attr,            /* 6 */
-       &sensor_dev_attr_fan1_label.dev_attr.attr,      /* 7 */
-       &sensor_dev_attr_fan2_input.dev_attr.attr,      /* 8 */
-       &sensor_dev_attr_pwm2.dev_attr.attr,            /* 9 */
-       &sensor_dev_attr_fan2_label.dev_attr.attr,      /* 10 */
+       &sensor_dev_attr_temp2_input.dev_attr.attr,     /* 1 */
+       &sensor_dev_attr_temp3_input.dev_attr.attr,     /* 2 */
+       &sensor_dev_attr_temp4_input.dev_attr.attr,     /* 3 */
+       &sensor_dev_attr_fan1_input.dev_attr.attr,      /* 4 */
+       &sensor_dev_attr_pwm1.dev_attr.attr,            /* 5 */
+       &sensor_dev_attr_fan2_input.dev_attr.attr,      /* 6 */
+       &sensor_dev_attr_pwm2.dev_attr.attr,            /* 7 */
        NULL
 };
 
 static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
                              int index)
 {
-       if ((index == 0 || index == 1) &&
-           !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
+       if (index == 0 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
                return 0;
-       if (index == 2 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP2))
+       if (index == 1 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP2))
                return 0;
-       if (index == 3 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP3))
+       if (index == 2 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP3))
                return 0;
-       if (index == 4 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP4))
+       if (index == 3 && !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP4))
                return 0;
-       if (index >= 5 && index <= 7 &&
+       if (index >= 4 && index <= 5 &&
            !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN1))
                return 0;
-       if (index >= 8 && index <= 10 &&
+       if (index >= 6 && index <= 7 &&
            !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN2))
                return 0;