Lines Matching refs:temp

56 	struct thermal_hwmon_temp *temp  in temp_input_show()  local
59 struct thermal_zone_device *tz = temp->tz; in temp_input_show()
74 struct thermal_hwmon_temp *temp in temp_crit_show() local
77 struct thermal_zone_device *tz = temp->tz; in temp_crit_show()
122 struct thermal_hwmon_temp *temp; in thermal_hwmon_lookup_temp() local
125 list_for_each_entry(temp, &hwmon->tz_list, hwmon_node) in thermal_hwmon_lookup_temp()
126 if (temp->tz == tz) { in thermal_hwmon_lookup_temp()
128 return temp; in thermal_hwmon_lookup_temp()
137 int temp; in thermal_zone_crit_temp_valid() local
138 return tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, &temp); in thermal_zone_crit_temp_valid()
144 struct thermal_hwmon_temp *temp; in thermal_add_hwmon_sysfs() local
169 temp = kzalloc(sizeof(*temp), GFP_KERNEL); in thermal_add_hwmon_sysfs()
170 if (!temp) { in thermal_add_hwmon_sysfs()
175 temp->tz = tz; in thermal_add_hwmon_sysfs()
178 snprintf(temp->temp_input.name, sizeof(temp->temp_input.name), in thermal_add_hwmon_sysfs()
180 temp->temp_input.attr.attr.name = temp->temp_input.name; in thermal_add_hwmon_sysfs()
181 temp->temp_input.attr.attr.mode = 0444; in thermal_add_hwmon_sysfs()
182 temp->temp_input.attr.show = temp_input_show; in thermal_add_hwmon_sysfs()
183 sysfs_attr_init(&temp->temp_input.attr.attr); in thermal_add_hwmon_sysfs()
184 result = device_create_file(hwmon->device, &temp->temp_input.attr); in thermal_add_hwmon_sysfs()
189 snprintf(temp->temp_crit.name, in thermal_add_hwmon_sysfs()
190 sizeof(temp->temp_crit.name), in thermal_add_hwmon_sysfs()
192 temp->temp_crit.attr.attr.name = temp->temp_crit.name; in thermal_add_hwmon_sysfs()
193 temp->temp_crit.attr.attr.mode = 0444; in thermal_add_hwmon_sysfs()
194 temp->temp_crit.attr.show = temp_crit_show; in thermal_add_hwmon_sysfs()
195 sysfs_attr_init(&temp->temp_crit.attr.attr); in thermal_add_hwmon_sysfs()
197 &temp->temp_crit.attr); in thermal_add_hwmon_sysfs()
205 list_add_tail(&temp->hwmon_node, &hwmon->tz_list); in thermal_add_hwmon_sysfs()
211 device_remove_file(hwmon->device, &temp->temp_input.attr); in thermal_add_hwmon_sysfs()
213 kfree(temp); in thermal_add_hwmon_sysfs()
227 struct thermal_hwmon_temp *temp; in thermal_remove_hwmon_sysfs() local
236 temp = thermal_hwmon_lookup_temp(hwmon, tz); in thermal_remove_hwmon_sysfs()
237 if (unlikely(!temp)) { in thermal_remove_hwmon_sysfs()
243 device_remove_file(hwmon->device, &temp->temp_input.attr); in thermal_remove_hwmon_sysfs()
245 device_remove_file(hwmon->device, &temp->temp_crit.attr); in thermal_remove_hwmon_sysfs()
248 list_del(&temp->hwmon_node); in thermal_remove_hwmon_sysfs()
249 kfree(temp); in thermal_remove_hwmon_sysfs()