Skip to contentSkip to conversation

lm75.c write values bel

PATCH New Christian Hohnstaedt 1 participant 1 message Jul 24, 2007 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lm75.c write values bel

Hi,

writing values < 0°C to TLow and THigh of the LM75 is not supported by the driver, since it strtoul()s instead of strtol()ing.

Trivial fix attached.

Christian Hohnstaedt

Signature · 11 lines
Christian Hohnstaedt
Software Engineer

Innominate Security Technologies AG  /protecting industrial networks/
tel: +49.30.6392-3285 fax: +49.30.6392-3307
Albert-Einstein-Strasse 14, D-12489 Berlin, Germany
http://www.innominate.com

Register Court: AG Charlottenburg, HR B 81603
Management Board: Joachim Fietz, Dirk Seewald
Chairman of the Supervisory Board: Edward M. Stadum
drivers/hwmon/lm75.c +1 -1
index a40166f..4fa3220 100644
@@ -95,7 +95,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da,
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm75_data *data = i2c_get_clientdata(client);
 	int nr = attr->index;
-	unsigned long temp = simple_strtoul(buf, NULL, 10);
+	int temp = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->temp[nr] = LM75_TEMP_TO_REG(temp);

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors