Lines Matching refs:hwmon
417 /* hwmon sys I/F */
418 #include <linux/hwmon.h>
424 struct thermal_hwmon_device *hwmon = dev_get_drvdata(dev);
425 return sprintf(buf, "%s\n", hwmon->type);
471 struct thermal_hwmon_device *hwmon;
476 list_for_each_entry(hwmon, &thermal_hwmon_list, node)
477 if (!strcmp(hwmon->type, tz->type)) {
484 hwmon = kzalloc(sizeof(struct thermal_hwmon_device), GFP_KERNEL);
485 if (!hwmon)
488 INIT_LIST_HEAD(&hwmon->tz_list);
489 strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH);
490 hwmon->device = hwmon_device_register(NULL);
491 if (IS_ERR(hwmon->device)) {
492 result = PTR_ERR(hwmon->device);
495 dev_set_drvdata(hwmon->device, hwmon);
496 result = device_create_file(hwmon->device, &dev_attr_name);
501 tz->hwmon = hwmon;
502 hwmon->count++;
505 "temp%d_input", hwmon->count);
510 result = device_create_file(hwmon->device, &tz->temp_input.attr);
518 "temp%d_crit", hwmon->count);
523 result = device_create_file(hwmon->device,
532 list_add_tail(&hwmon->node, &thermal_hwmon_list);
533 list_add_tail(&tz->hwmon_node, &hwmon->tz_list);
539 device_remove_file(hwmon->device, &tz->temp_crit.attr);
540 device_remove_file(hwmon->device, &tz->temp_input.attr);
542 device_remove_file(hwmon->device, &dev_attr_name);
543 hwmon_device_unregister(hwmon->device);
547 kfree(hwmon);
555 struct thermal_hwmon_device *hwmon = tz->hwmon;
557 tz->hwmon = NULL;
558 device_remove_file(hwmon->device, &tz->temp_input.attr);
559 device_remove_file(hwmon->device, &tz->temp_crit.attr);
563 if (!list_empty(&hwmon->tz_list)) {
567 list_del(&hwmon->node);
570 device_remove_file(hwmon->device, &dev_attr_name);
571 hwmon_device_unregister(hwmon->device);
572 kfree(hwmon);