From 9d60f01cec2378a1a5955c3498d0bed3cb01ba4f Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 22 Oct 2007 18:06:23 +0000 Subject: [PATCH] Handle gl518sm chips with no input values for in0, in1 and in2. This will happen with the Linux 2.6 driver soon. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4976 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/sensors/chips.c | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 07d592ac..b44b1b60 100644 --- a/CHANGES +++ b/CHANGES @@ -36,6 +36,7 @@ SVN HEAD Hide error on missing dme1737 fan and pwm Add thmc50/adm1022 support Hide error on missing adm1021 die code + Handle gl518sm with no voltage input values Program sensors-detect: Don't probe i2c-isa as a regular i2c bus Add Winbond W83L786NR/NG/R/G detection Add Winbond W83L771W/G detection diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 792de9d9..a0d2dd75 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -1036,12 +1036,11 @@ void print_gl518(const sensors_chip_name *name) * of the GL518SM, we cannot read their values. This is detected when the * reading would be 0.0 V and displayed as "(n/a)" instead. */ if (!sensors_get_label_and_valid(*name,SENSORS_GL518_VDD,&label,&valid) && - !sensors_get_feature(*name,SENSORS_GL518_VDD,&cur) && !sensors_get_feature(*name,SENSORS_GL518_VDD_MIN,&min) && !sensors_get_feature(*name,SENSORS_GL518_VDD_MAX,&max)) { if (valid) { print_label(label,10); - if (cur == 0.0) + if (sensors_get_feature(*name, SENSORS_GL518_VDD, &cur) || cur == 0.0) printf("(n/a) "); else printf("%+6.2f V ",cur); @@ -1054,12 +1053,11 @@ void print_gl518(const sensors_chip_name *name) free(label); if (!sensors_get_label_and_valid(*name,SENSORS_GL518_VIN1,&label,&valid) && - !sensors_get_feature(*name,SENSORS_GL518_VIN1,&cur) && !sensors_get_feature(*name,SENSORS_GL518_VIN1_MIN,&min) && !sensors_get_feature(*name,SENSORS_GL518_VIN1_MAX,&max)) { if (valid) { print_label(label,10); - if (cur == 0.0) + if (sensors_get_feature(*name, SENSORS_GL518_VIN1, &cur) || cur == 0.0) printf("(n/a) "); else printf("%+6.2f V ",cur); @@ -1072,12 +1070,11 @@ void print_gl518(const sensors_chip_name *name) free(label); if (!sensors_get_label_and_valid(*name,SENSORS_GL518_VIN2,&label,&valid) && - !sensors_get_feature(*name,SENSORS_GL518_VIN2,&cur) && !sensors_get_feature(*name,SENSORS_GL518_VIN2_MIN,&min) && !sensors_get_feature(*name,SENSORS_GL518_VIN2_MAX,&max)) { if (valid) { print_label(label,10); - if (cur == 0.0) + if (sensors_get_feature(*name, SENSORS_GL518_VIN2, &cur) || cur == 0.0) printf("(n/a) "); else printf("%+6.2f V ",cur);