You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
hwmon: Allow writing of negative trigger temperatures
- replace differing temperature variable types by long - use strtol() instead of strtoul() for conversion Signed-off-by: Christian Hohnstaedt <chohnstaedt@innominate.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
This commit is contained in:
committed by
Mark M. Hoffman
parent
dcf3b5fb7f
commit
5bfedac045
@@ -413,7 +413,7 @@ static int LM93_TEMP_FROM_REG(u8 reg)
|
||||
|
||||
/* TEMP: 1/1000 degrees C (-128C to +127C)
|
||||
REG: 1C/bit, two's complement */
|
||||
static u8 LM93_TEMP_TO_REG(int temp)
|
||||
static u8 LM93_TEMP_TO_REG(long temp)
|
||||
{
|
||||
int ntemp = SENSORS_LIMIT(temp, LM93_TEMP_MIN, LM93_TEMP_MAX);
|
||||
ntemp += (ntemp<0 ? -500 : 500);
|
||||
@@ -1268,7 +1268,7 @@ static ssize_t store_temp_min(struct device *dev, struct device_attribute *attr,
|
||||
int nr = (to_sensor_dev_attr(attr))->index;
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct lm93_data *data = i2c_get_clientdata(client);
|
||||
u32 val = simple_strtoul(buf, NULL, 10);
|
||||
long val = simple_strtol(buf, NULL, 10);
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
data->temp_lim[nr].min = LM93_TEMP_TO_REG(val);
|
||||
@@ -1298,7 +1298,7 @@ static ssize_t store_temp_max(struct device *dev, struct device_attribute *attr,
|
||||
int nr = (to_sensor_dev_attr(attr))->index;
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct lm93_data *data = i2c_get_clientdata(client);
|
||||
u32 val = simple_strtoul(buf, NULL, 10);
|
||||
long val = simple_strtol(buf, NULL, 10);
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
data->temp_lim[nr].max = LM93_TEMP_TO_REG(val);
|
||||
@@ -1329,7 +1329,7 @@ static ssize_t store_temp_auto_base(struct device *dev,
|
||||
int nr = (to_sensor_dev_attr(attr))->index;
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct lm93_data *data = i2c_get_clientdata(client);
|
||||
u32 val = simple_strtoul(buf, NULL, 10);
|
||||
long val = simple_strtol(buf, NULL, 10);
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
data->block10.base[nr] = LM93_TEMP_TO_REG(val);
|
||||
@@ -1360,7 +1360,7 @@ static ssize_t store_temp_auto_boost(struct device *dev,
|
||||
int nr = (to_sensor_dev_attr(attr))->index;
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct lm93_data *data = i2c_get_clientdata(client);
|
||||
u32 val = simple_strtoul(buf, NULL, 10);
|
||||
long val = simple_strtol(buf, NULL, 10);
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
data->boost[nr] = LM93_TEMP_TO_REG(val);
|
||||
|
||||
Reference in New Issue
Block a user