Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36723
b: refs/heads/master
c: 8ab4ec3
h: refs/heads/master
i:
  36721: dc7cada
  36719: 8df2796
v: v3
  • Loading branch information
Jean Delvare authored and Greg Kroah-Hartman committed Sep 28, 2006
1 parent 97b7509 commit 07f84f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: 3543a53f6c5b58c233218327f671108590151876
refs/heads/master: 8ab4ec3ef45cc2facbe14c733ef7230e7d94fcf2
14 changes: 7 additions & 7 deletions trunk/drivers/hwmon/it87.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,14 +564,14 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
struct i2c_client *client = to_i2c_client(dev);
struct it87_data *data = i2c_get_clientdata(client);
unsigned long val = simple_strtoul(buf, NULL, 10);
int i, min[3];
int min;
u8 old;

mutex_lock(&data->update_lock);
old = it87_read_value(client, IT87_REG_FAN_DIV);

for (i = 0; i < 3; i++)
min[i] = FAN_FROM_REG(data->fan_min[i], DIV_FROM_REG(data->fan_div[i]));
/* Save fan min limit */
min = FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr]));

switch (nr) {
case 0:
Expand All @@ -591,10 +591,10 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
val |= 0x1 << 6;
it87_write_value(client, IT87_REG_FAN_DIV, val);

for (i = 0; i < 3; i++) {
data->fan_min[i]=FAN_TO_REG(min[i], DIV_FROM_REG(data->fan_div[i]));
it87_write_value(client, IT87_REG_FAN_MIN(i), data->fan_min[i]);
}
/* Restore fan min limit */
data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr]));
it87_write_value(client, IT87_REG_FAN_MIN(nr), data->fan_min[nr]);

mutex_unlock(&data->update_lock);
return count;
}
Expand Down

0 comments on commit 07f84f1

Please sign in to comment.