X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fhwmon%2Fsis5595.c;h=029a2e15a9c2958ea7514199a065e5dddadbd02f;hb=5d3ecc8aa8eb3dc677d5214464a0b01e7b5e1d26;hp=47d7ce9af8fb83121fafdb3b5c3ba8a3454740a5;hpb=b9020c9e5953f6938e1968ba0034b46292ac5d51;p=pandora-kernel.git diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c index 47d7ce9af8fb..029a2e15a9c2 100644 --- a/drivers/hwmon/sis5595.c +++ b/drivers/hwmon/sis5595.c @@ -133,6 +133,8 @@ static inline u8 FAN_TO_REG(long rpm, int div) { if (rpm <= 0) return 255; + if (rpm > 1350000) + return 1; return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1, 254); } @@ -147,7 +149,7 @@ static inline int TEMP_FROM_REG(s8 val) { return val * 830 + 52120; } -static inline s8 TEMP_TO_REG(int val) +static inline s8 TEMP_TO_REG(long val) { int nval = SENSORS_LIMIT(val, -54120, 157530) ; return nval<0 ? (nval-5212-415)/830 : (nval-5212+415)/830;