mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-29 21:08:19 +00:00
Cleanups backported from Linux 2.6 by Aurelien Jarno.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2868 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
1756f8d8dd
commit
cb2e5b3d27
2 files changed
+17
-26
No files matched your search
+2
-4
@@ -78,9 +78,8 @@ SENSORS_INSMOD_3(lm78, lm78j, lm79);
|
||||
|
||||
static inline u8 FAN_TO_REG(long rpm, int div)
|
||||
{
|
||||
if (rpm == 0)
|
||||
if (rpm <= 0)
|
||||
return 255;
|
||||
rpm = SENSORS_LIMIT(rpm, 1, 1000000);
|
||||
return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1,
|
||||
254);
|
||||
}
|
||||
@@ -93,7 +92,6 @@ static inline u8 FAN_TO_REG(long rpm, int div)
|
||||
|
||||
#define VID_FROM_REG(val) ((val)==0x1f?0:(val)>=0x10?510-(val)*10:\
|
||||
205-(val)*5)
|
||||
#define ALARMS_FROM_REG(val) (val)
|
||||
|
||||
#define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1)
|
||||
#define DIV_FROM_REG(val) (1 << (val))
|
||||
@@ -655,7 +653,7 @@ void lm78_alarms(struct i2c_client *client, int operation, int ctl_name,
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
lm78_update_client(client);
|
||||
results[0] = ALARMS_FROM_REG(data->alarms);
|
||||
results[0] = data->alarms;
|
||||
*nrels_mag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user