aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-06 15:15:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-06 15:15:26 -0500
commitddf8a0d385979065af7be086a4b89b6a645fe340 (patch)
tree5a790adbac4dc30db60bbc3979187f6ac0de0f64
parent9991357259a5718813881bae96d3704bb3f531e2 (diff)
parentbfa02b0da66965caf46e441270af87edda4fea14 (diff)
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: (w83627ehf) Fix broken driver init hwmon: (coretemp) Fix for non-SMP builds
-rw-r--r--drivers/hwmon/coretemp.c3
-rw-r--r--drivers/hwmon/w83627ehf.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index ce18c046f728..104b3767516c 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -60,14 +60,13 @@ MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius");
60#ifdef CONFIG_SMP 60#ifdef CONFIG_SMP
61#define TO_PHYS_ID(cpu) cpu_data(cpu).phys_proc_id 61#define TO_PHYS_ID(cpu) cpu_data(cpu).phys_proc_id
62#define TO_CORE_ID(cpu) cpu_data(cpu).cpu_core_id 62#define TO_CORE_ID(cpu) cpu_data(cpu).cpu_core_id
63#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)
64#define for_each_sibling(i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu)) 63#define for_each_sibling(i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu))
65#else 64#else
66#define TO_PHYS_ID(cpu) (cpu) 65#define TO_PHYS_ID(cpu) (cpu)
67#define TO_CORE_ID(cpu) (cpu) 66#define TO_CORE_ID(cpu) (cpu)
68#define TO_ATTR_NO(cpu) (cpu)
69#define for_each_sibling(i, cpu) for (i = 0; false; ) 67#define for_each_sibling(i, cpu) for (i = 0; false; )
70#endif 68#endif
69#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)
71 70
72/* 71/*
73 * Per-Core Temperature Data 72 * Per-Core Temperature Data
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 483cb268781e..93f5fc7d6059 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -1835,12 +1835,15 @@ static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data,
1835 diode = 0x70; 1835 diode = 0x70;
1836 } 1836 }
1837 for (i = 0; i < 3; i++) { 1837 for (i = 0; i < 3; i++) {
1838 const char *label = data->temp_label[data->temp_src[i]]; 1838 const char *label = NULL;
1839
1840 if (data->temp_label)
1841 label = data->temp_label[data->temp_src[i]];
1839 1842
1840 /* Digital source overrides analog type */ 1843 /* Digital source overrides analog type */
1841 if (strncmp(label, "PECI", 4) == 0) 1844 if (label && strncmp(label, "PECI", 4) == 0)
1842 data->temp_type[i] = 6; 1845 data->temp_type[i] = 6;
1843 else if (strncmp(label, "AMD", 3) == 0) 1846 else if (label && strncmp(label, "AMD", 3) == 0)
1844 data->temp_type[i] = 5; 1847 data->temp_type[i] = 5;
1845 else if ((tmp & (0x02 << i))) 1848 else if ((tmp & (0x02 << i)))
1846 data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 3; 1849 data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 3;