From 90c1efe60665d8b49d971c44c828f6d5db036922 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 5 Jul 2007 20:44:31 +0000 Subject: [PATCH] lm85: Fix setting the fan speed min limit to 0. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4557 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + kernel/chips/lm85.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 079c56d3..d7968513 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ SVN HEAD Add support for the w83627ehf thermal sensor types Man page sensors.conf.5: Update the chip statement section Module i2c-nforce2: Add nForce MCP61, MCP65 support (2.6 backport) + Module lm85: Fix setting the fan speed min limit to 0 Module w83627ehf: New (2.6 backport) Programs i2cdump, i2cget, i2cset: Do not force the slave address by default Program i2cdump: Use the new I2C block read function diff --git a/kernel/chips/lm85.c b/kernel/chips/lm85.c index 4f45e892..2b65d342 100644 --- a/kernel/chips/lm85.c +++ b/kernel/chips/lm85.c @@ -186,7 +186,7 @@ static int lm85_scaling[] = { /* .001 Volts */ #define INS_FROM_REG(n,val) (INSEXT_FROM_REG(n,val,0)) /* FAN speed is measured using 90kHz clock */ -#define FAN_TO_REG(val) (SENSORS_LIMIT( (val)<=0?0: 5400000/(val),0,65534)) +#define FAN_TO_REG(val) ((val)<=0?0xffff:SENSORS_LIMIT(5400000/(val),1,65534)) #define FAN_FROM_REG(val) ((val)==0?-1:(val)==0xffff?0:5400000/(val)) /* Temperature is reported in .01 degC increments */