From a7a75c729dcb30bbe9a3616fbf5027037a75342b Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 4 Sep 2007 15:59:33 +0000 Subject: [PATCH] Fix the magnitude of temperature offsets in Linux 2.6. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4751 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + lib/proc.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index edfa70bb..7fc7bcee 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,7 @@ SVN HEAD Fix lm93 VID support for Linux 2.6 Fix adm1024 support for Linux 2.6 Fix maxilife support for Linux 2.6 + Fix magnitude of temperature offsets in Linux 2.6 Makefile: Fix kernel version detection (#2187) Module fscher: Add missing read of control register (2.6 backport) Module i2c-piix4: Add ATI SB700 and SB800 support (2.6 backport) diff --git a/lib/proc.c b/lib/proc.c index 0b825540..d18cfa4a 100644 --- a/lib/proc.c +++ b/lib/proc.c @@ -290,6 +290,7 @@ static const struct match matches[] = { temp%d_low -> temp%d_min temp%d_crit -> temp%d_crit (for magnitude) temp%d_state -> temp%d_status + temp%d_offset -> temp%d_offset (for magnitude) temp%d -> temp%d_input sensor%d -> temp%d_type AND all conversions listed in the matches[] structure above. @@ -414,6 +415,11 @@ static int getsysname(const sensors_chip_feature *feature, char *sysname, *sysmag = 0; return 0; } + if(sscanf(name, "temp%d_offse%c%c", &num, &last, &check) == 2 && last == 't') { + sprintf(sysname, "temp%d_offset", num); + *sysmag = TEMPMAG; + return 0; + } if(sscanf(name, "temp%d%c", &num, &check) == 1) { sprintf(sysname, "temp%d_input", num); *sysmag = TEMPMAG;