From: Jean Delvare Date: Sun, 6 Nov 2011 19:25:18 +0000 (+0100) Subject: hwmon: (coretemp) Fix for non-SMP builds X-Git-Tag: v3.0.9~53 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0fb2a32e2c8f58b5d43846e4de46364998f9af5d;p=karo-tx-linux.git hwmon: (coretemp) Fix for non-SMP builds commit 2aba6cac2a84f3b80e11a680c34d55e7739b474d upstream. The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP definition resolves to the correct value, just use this for both cases. Without this fix the temperature attributes are named temp0_* instead of temp2_*, so libsensors won't pick them. Broken since kernel 3.0. Signed-off-by: Jean Delvare Tested-by: Phil Sutter Acked-by: Durgadoss R Acked-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 0070d5476dd0..f64219408415 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -50,14 +50,13 @@ #ifdef CONFIG_SMP #define TO_PHYS_ID(cpu) cpu_data(cpu).phys_proc_id #define TO_CORE_ID(cpu) cpu_data(cpu).cpu_core_id -#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO) #define for_each_sibling(i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu)) #else #define TO_PHYS_ID(cpu) (cpu) #define TO_CORE_ID(cpu) (cpu) -#define TO_ATTR_NO(cpu) (cpu) #define for_each_sibling(i, cpu) for (i = 0; false; ) #endif +#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO) /* * Per-Core Temperature Data