Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189902
b: refs/heads/master
c: 8acf07c
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare committed Apr 14, 2010
1 parent 1edeb0e commit 710557f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: a00afb97e23fd904b12a3f4de3237d8ab2f68738
refs/heads/master: 8acf07c5a7674e53f2d320d540aec5d714b105cf
20 changes: 10 additions & 10 deletions trunk/drivers/hwmon/it87.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,29 +539,29 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr,

struct it87_data *data = dev_get_drvdata(dev);
long val;
u8 reg;

if (strict_strtol(buf, 10, &val) < 0)
return -EINVAL;

mutex_lock(&data->update_lock);

data->sensor = it87_read_value(data, IT87_REG_TEMP_ENABLE);
data->sensor &= ~(1 << nr);
data->sensor &= ~(8 << nr);
reg = it87_read_value(data, IT87_REG_TEMP_ENABLE);
reg &= ~(1 << nr);
reg &= ~(8 << nr);
if (val == 2) { /* backwards compatibility */
dev_warn(dev, "Sensor type 2 is deprecated, please use 4 "
"instead\n");
val = 4;
}
/* 3 = thermal diode; 4 = thermistor; 0 = disabled */
if (val == 3)
data->sensor |= 1 << nr;
reg |= 1 << nr;
else if (val == 4)
data->sensor |= 8 << nr;
else if (val != 0) {
mutex_unlock(&data->update_lock);
reg |= 8 << nr;
else if (val != 0)
return -EINVAL;
}

mutex_lock(&data->update_lock);
data->sensor = reg;
it87_write_value(data, IT87_REG_TEMP_ENABLE, data->sensor);
mutex_unlock(&data->update_lock);
return count;
Expand Down

0 comments on commit 710557f

Please sign in to comment.