Lines Matching refs:temp

76 	struct thermal_hwmon_temp *temp  in temp_input_show()  local
79 struct thermal_zone_device *tz = temp->tz; in temp_input_show()
94 struct thermal_hwmon_temp *temp in temp_crit_show() local
97 struct thermal_zone_device *tz = temp->tz; in temp_crit_show()
130 struct thermal_hwmon_temp *temp; in thermal_hwmon_lookup_temp() local
133 list_for_each_entry(temp, &hwmon->tz_list, hwmon_node) in thermal_hwmon_lookup_temp()
134 if (temp->tz == tz) { in thermal_hwmon_lookup_temp()
136 return temp; in thermal_hwmon_lookup_temp()
145 int temp; in thermal_zone_crit_temp_valid() local
146 return tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, &temp); in thermal_zone_crit_temp_valid()
152 struct thermal_hwmon_temp *temp; in thermal_add_hwmon_sysfs() local
179 temp = kzalloc(sizeof(*temp), GFP_KERNEL); in thermal_add_hwmon_sysfs()
180 if (!temp) { in thermal_add_hwmon_sysfs()
185 temp->tz = tz; in thermal_add_hwmon_sysfs()
188 snprintf(temp->temp_input.name, sizeof(temp->temp_input.name), in thermal_add_hwmon_sysfs()
190 temp->temp_input.attr.attr.name = temp->temp_input.name; in thermal_add_hwmon_sysfs()
191 temp->temp_input.attr.attr.mode = 0444; in thermal_add_hwmon_sysfs()
192 temp->temp_input.attr.show = temp_input_show; in thermal_add_hwmon_sysfs()
193 sysfs_attr_init(&temp->temp_input.attr.attr); in thermal_add_hwmon_sysfs()
194 result = device_create_file(hwmon->device, &temp->temp_input.attr); in thermal_add_hwmon_sysfs()
199 snprintf(temp->temp_crit.name, in thermal_add_hwmon_sysfs()
200 sizeof(temp->temp_crit.name), in thermal_add_hwmon_sysfs()
202 temp->temp_crit.attr.attr.name = temp->temp_crit.name; in thermal_add_hwmon_sysfs()
203 temp->temp_crit.attr.attr.mode = 0444; in thermal_add_hwmon_sysfs()
204 temp->temp_crit.attr.show = temp_crit_show; in thermal_add_hwmon_sysfs()
205 sysfs_attr_init(&temp->temp_crit.attr.attr); in thermal_add_hwmon_sysfs()
207 &temp->temp_crit.attr); in thermal_add_hwmon_sysfs()
215 list_add_tail(&temp->hwmon_node, &hwmon->tz_list); in thermal_add_hwmon_sysfs()
221 device_remove_file(hwmon->device, &temp->temp_input.attr); in thermal_add_hwmon_sysfs()
223 kfree(temp); in thermal_add_hwmon_sysfs()
239 struct thermal_hwmon_temp *temp; in thermal_remove_hwmon_sysfs() local
248 temp = thermal_hwmon_lookup_temp(hwmon, tz); in thermal_remove_hwmon_sysfs()
249 if (unlikely(!temp)) { in thermal_remove_hwmon_sysfs()
255 device_remove_file(hwmon->device, &temp->temp_input.attr); in thermal_remove_hwmon_sysfs()
257 device_remove_file(hwmon->device, &temp->temp_crit.attr); in thermal_remove_hwmon_sysfs()
260 list_del(&temp->hwmon_node); in thermal_remove_hwmon_sysfs()
261 kfree(temp); in thermal_remove_hwmon_sysfs()