1 From 3f4f09b4be35d38d6e2bf22c989443e65e70fc4c Mon Sep 17 00:00:00 2001
2 From: Jean Delvare <khali@linux-fr.org>
3 Date: Fri, 9 Jul 2010 16:22:51 +0200
4 Subject: hwmon: (coretemp) Properly label the sensors
6 From: Jean Delvare <khali@linux-fr.org>
8 commit 3f4f09b4be35d38d6e2bf22c989443e65e70fc4c upstream.
10 Don't assume that CPU entry number and core ID always match. It
11 worked in the simple cases (single CPU, no HT) but fails on
14 Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 Acked-by: Huaxu Wan <huaxu.wan@intel.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
19 drivers/hwmon/coretemp.c | 6 +++++-
20 1 file changed, 5 insertions(+), 1 deletion(-)
22 --- a/drivers/hwmon/coretemp.c
23 +++ b/drivers/hwmon/coretemp.c
24 @@ -53,6 +53,7 @@ struct coretemp_data {
25 struct mutex update_lock;
29 char valid; /* zero until following fields are valid */
30 unsigned long last_updated; /* in jiffies */
32 @@ -75,7 +76,7 @@ static ssize_t show_name(struct device *
33 if (attr->index == SHOW_NAME)
34 ret = sprintf(buf, "%s\n", data->name);
36 - ret = sprintf(buf, "Core %d\n", data->id);
37 + ret = sprintf(buf, "Core %d\n", data->core_id);
41 @@ -255,6 +256,9 @@ static int __devinit coretemp_probe(stru
46 + data->core_id = c->cpu_core_id;
48 data->name = "coretemp";
49 mutex_init(&data->update_lock);