aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 13:11:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 13:11:42 -0400
commit74e6392ca3fd445a775dd42b54d5e42cf1e706e6 (patch)
treeea6f7b1eaeea6b1beb8174a76ff998d51bf0972b
parent09cefbb605ccb07c65f313253268a634e0dcd283 (diff)
parent582e1b270f6db93007f9af86d4f28fdad3da0505 (diff)
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging: hwmon: (coretemp) Fix section mismatch hwmon: (pmbus) Initialize sysfs attributes hwmon: (coretemp) Update comments describing the handling of HT CPUs hwmon: (coretemp) Initialize sysfs attributes
-rw-r--r--drivers/hwmon/coretemp.c16
-rw-r--r--drivers/hwmon/pmbus_core.c1
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 9577c432e77f..de3d2465fe24 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -350,6 +350,7 @@ static int get_pkg_tjmax(unsigned int cpu, struct device *dev)
350 350
351static int create_name_attr(struct platform_data *pdata, struct device *dev) 351static int create_name_attr(struct platform_data *pdata, struct device *dev)
352{ 352{
353 sysfs_attr_init(&pdata->name_attr.attr);
353 pdata->name_attr.attr.name = "name"; 354 pdata->name_attr.attr.name = "name";
354 pdata->name_attr.attr.mode = S_IRUGO; 355 pdata->name_attr.attr.mode = S_IRUGO;
355 pdata->name_attr.show = show_name; 356 pdata->name_attr.show = show_name;
@@ -372,6 +373,7 @@ static int create_core_attrs(struct temp_data *tdata, struct device *dev,
372 for (i = 0; i < MAX_ATTRS; i++) { 373 for (i = 0; i < MAX_ATTRS; i++) {
373 snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH, names[i], 374 snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH, names[i],
374 attr_no); 375 attr_no);
376 sysfs_attr_init(&tdata->sd_attrs[i].dev_attr.attr);
375 tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i]; 377 tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i];
376 tdata->sd_attrs[i].dev_attr.attr.mode = S_IRUGO; 378 tdata->sd_attrs[i].dev_attr.attr.mode = S_IRUGO;
377 tdata->sd_attrs[i].dev_attr.show = rd_ptr[i]; 379 tdata->sd_attrs[i].dev_attr.show = rd_ptr[i];
@@ -422,7 +424,7 @@ static void update_ttarget(__u8 cpu_model, struct temp_data *tdata,
422 } 424 }
423} 425}
424 426
425static int chk_ucode_version(struct platform_device *pdev) 427static int __devinit chk_ucode_version(struct platform_device *pdev)
426{ 428{
427 struct cpuinfo_x86 *c = &cpu_data(pdev->id); 429 struct cpuinfo_x86 *c = &cpu_data(pdev->id);
428 int err; 430 int err;
@@ -509,8 +511,8 @@ static int create_core_data(struct platform_data *pdata,
509 /* 511 /*
510 * Provide a single set of attributes for all HT siblings of a core 512 * Provide a single set of attributes for all HT siblings of a core
511 * to avoid duplicate sensors (the processor ID and core ID of all 513 * to avoid duplicate sensors (the processor ID and core ID of all
512 * HT siblings of a core is the same). 514 * HT siblings of a core are the same).
513 * Skip if a HT sibling of this core is already online. 515 * Skip if a HT sibling of this core is already registered.
514 * This is not an error. 516 * This is not an error.
515 */ 517 */
516 if (pdata->core_data[attr_no] != NULL) 518 if (pdata->core_data[attr_no] != NULL)
@@ -770,10 +772,10 @@ static void __cpuinit put_core_offline(unsigned int cpu)
770 coretemp_remove_core(pdata, &pdev->dev, indx); 772 coretemp_remove_core(pdata, &pdev->dev, indx);
771 773
772 /* 774 /*
773 * If a core is taken offline, but a HT sibling of the same core is 775 * If a HT sibling of a core is taken offline, but another HT sibling
774 * still online, register the alternate sibling. This ensures that 776 * of the same core is still online, register the alternate sibling.
775 * exactly one set of attributes is provided as long as at least one 777 * This ensures that exactly one set of attributes is provided as long
776 * HT sibling of a core is online. 778 * as at least one HT sibling of a core is online.
777 */ 779 */
778 for_each_sibling(i, cpu) { 780 for_each_sibling(i, cpu) {
779 if (i != cpu) { 781 if (i != cpu) {
diff --git a/drivers/hwmon/pmbus_core.c b/drivers/hwmon/pmbus_core.c
index 98799bab69ce..354770ed3186 100644
--- a/drivers/hwmon/pmbus_core.c
+++ b/drivers/hwmon/pmbus_core.c
@@ -707,6 +707,7 @@ do { \
707 struct sensor_device_attribute *a \ 707 struct sensor_device_attribute *a \
708 = &data->_type##s[data->num_##_type##s].attribute; \ 708 = &data->_type##s[data->num_##_type##s].attribute; \
709 BUG_ON(data->num_attributes >= data->max_attributes); \ 709 BUG_ON(data->num_attributes >= data->max_attributes); \
710 sysfs_attr_init(&a->dev_attr.attr); \
710 a->dev_attr.attr.name = _name; \ 711 a->dev_attr.attr.name = _name; \
711 a->dev_attr.attr.mode = _mode; \ 712 a->dev_attr.attr.mode = _mode; \
712 a->dev_attr.show = _show; \ 713 a->dev_attr.show = _show; \