1 From 2aba6cac2a84f3b80e11a680c34d55e7739b474d Mon Sep 17 00:00:00 2001
2 From: Jean Delvare <khali@linux-fr.org>
3 Date: Sun, 6 Nov 2011 20:25:18 +0100
4 Subject: hwmon: (coretemp) Fix for non-SMP builds
6 From: Jean Delvare <khali@linux-fr.org>
8 commit 2aba6cac2a84f3b80e11a680c34d55e7739b474d upstream.
10 The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP
11 definition resolves to the correct value, just use this for both
14 Without this fix the temperature attributes are named temp0_* instead
15 of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.
17 Signed-off-by: Jean Delvare <khali@linux-fr.org>
18 Tested-by: Phil Sutter <phil@nwl.cc>
19 Acked-by: Durgadoss R <Durgadoss.r@intel.com>
20 Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
24 drivers/hwmon/coretemp.c | 3 +--
25 1 file changed, 1 insertion(+), 2 deletions(-)
27 --- a/drivers/hwmon/coretemp.c
28 +++ b/drivers/hwmon/coretemp.c
29 @@ -60,14 +60,13 @@ MODULE_PARM_DESC(tjmax, "TjMax value in
31 #define TO_PHYS_ID(cpu) cpu_data(cpu).phys_proc_id
32 #define TO_CORE_ID(cpu) cpu_data(cpu).cpu_core_id
33 -#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)
34 #define for_each_sibling(i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu))
36 #define TO_PHYS_ID(cpu) (cpu)
37 #define TO_CORE_ID(cpu) (cpu)
38 -#define TO_ATTR_NO(cpu) (cpu)
39 #define for_each_sibling(i, cpu) for (i = 0; false; )
41 +#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)
44 * Per-Core Temperature Data