Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115545
b: refs/heads/master
c: 366716e
h: refs/heads/master
i:
  115543: a16a8c7
v: v3
  • Loading branch information
Corentin Labbe authored and Jean Delvare committed Oct 17, 2008
1 parent 67b53b7 commit 12bfd91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d664a4809e73c878a43607d584b2e2b60fd07468
refs/heads/master: 366716e6aabfb6f7c65525cc1637e035bfaf422d
5 changes: 3 additions & 2 deletions trunk/drivers/hwmon/adm1029.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -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]));
}
Expand Down

0 comments on commit 12bfd91

Please sign in to comment.