]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/hwmon/adm1029.c
Extra omap code in linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / hwmon / adm1029.c
index ba84ca5923f9271c4e888f6caff75c25bef0f49d..36718150b475423573822b871c3ec4a8f9e4b421 100644 (file)
@@ -179,7 +179,8 @@ show_fan(struct device *dev, struct device_attribute *devattr, char *buf)
        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
        struct adm1029_data *data = adm1029_update_device(dev);
        u16 val;
-       if (data->fan[attr->index] == 0 || data->fan_div[attr->index] == 0
+       if (data->fan[attr->index] == 0
+           || (data->fan_div[attr->index] & 0xC0) == 0
            || data->fan[attr->index] == 255) {
                return sprintf(buf, "0\n");
        }
@@ -194,7 +195,7 @@ show_fan_div(struct device *dev, struct device_attribute *devattr, char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
        struct adm1029_data *data = adm1029_update_device(dev);
-       if (data->fan_div[attr->index] == 0)
+       if ((data->fan_div[attr->index] & 0xC0) == 0)
                return sprintf(buf, "0\n");
        return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[attr->index]));
 }