summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-06 12:15:26 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-06 12:15:26 -0800
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");
#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
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,
diode = 0x70;
}
for (i = 0; i < 3; i++) {
- const char *label = data->temp_label[data->temp_src[i]];
+ const char *label = NULL;
+
+ if (data->temp_label)
+ label = data->temp_label[data->temp_src[i]];
/* Digital source overrides analog type */
- if (strncmp(label, "PECI", 4) == 0)
+ if (label && strncmp(label, "PECI", 4) == 0)
data->temp_type[i] = 6;
- else if (strncmp(label, "AMD", 3) == 0)
+ else if (label && strncmp(label, "AMD", 3) == 0)
data->temp_type[i] = 5;
else if ((tmp & (0x02 << i)))
data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 3;