Lines Matching refs:temp
55 struct thermal_hwmon_temp *temp in temp_input_show() local
58 struct thermal_zone_device *tz = temp->tz; in temp_input_show()
73 struct thermal_hwmon_temp *temp in temp_crit_show() local
76 struct thermal_zone_device *tz = temp->tz; in temp_crit_show()
113 struct thermal_hwmon_temp *temp; in thermal_hwmon_lookup_temp() local
116 list_for_each_entry(temp, &hwmon->tz_list, hwmon_node) in thermal_hwmon_lookup_temp()
117 if (temp->tz == tz) { in thermal_hwmon_lookup_temp()
119 return temp; in thermal_hwmon_lookup_temp()
128 int temp; in thermal_zone_crit_temp_valid() local
129 return tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, &temp); in thermal_zone_crit_temp_valid()
135 struct thermal_hwmon_temp *temp; in thermal_add_hwmon_sysfs() local
160 temp = kzalloc(sizeof(*temp), GFP_KERNEL); in thermal_add_hwmon_sysfs()
161 if (!temp) { in thermal_add_hwmon_sysfs()
166 temp->tz = tz; in thermal_add_hwmon_sysfs()
169 snprintf(temp->temp_input.name, sizeof(temp->temp_input.name), in thermal_add_hwmon_sysfs()
171 temp->temp_input.attr.attr.name = temp->temp_input.name; in thermal_add_hwmon_sysfs()
172 temp->temp_input.attr.attr.mode = 0444; in thermal_add_hwmon_sysfs()
173 temp->temp_input.attr.show = temp_input_show; in thermal_add_hwmon_sysfs()
174 sysfs_attr_init(&temp->temp_input.attr.attr); in thermal_add_hwmon_sysfs()
175 result = device_create_file(hwmon->device, &temp->temp_input.attr); in thermal_add_hwmon_sysfs()
180 snprintf(temp->temp_crit.name, in thermal_add_hwmon_sysfs()
181 sizeof(temp->temp_crit.name), in thermal_add_hwmon_sysfs()
183 temp->temp_crit.attr.attr.name = temp->temp_crit.name; in thermal_add_hwmon_sysfs()
184 temp->temp_crit.attr.attr.mode = 0444; in thermal_add_hwmon_sysfs()
185 temp->temp_crit.attr.show = temp_crit_show; in thermal_add_hwmon_sysfs()
186 sysfs_attr_init(&temp->temp_crit.attr.attr); in thermal_add_hwmon_sysfs()
188 &temp->temp_crit.attr); in thermal_add_hwmon_sysfs()
196 list_add_tail(&temp->hwmon_node, &hwmon->tz_list); in thermal_add_hwmon_sysfs()
202 device_remove_file(hwmon->device, &temp->temp_input.attr); in thermal_add_hwmon_sysfs()
204 kfree(temp); in thermal_add_hwmon_sysfs()
218 struct thermal_hwmon_temp *temp; in thermal_remove_hwmon_sysfs() local
227 temp = thermal_hwmon_lookup_temp(hwmon, tz); in thermal_remove_hwmon_sysfs()
228 if (unlikely(!temp)) { in thermal_remove_hwmon_sysfs()
234 device_remove_file(hwmon->device, &temp->temp_input.attr); in thermal_remove_hwmon_sysfs()
236 device_remove_file(hwmon->device, &temp->temp_crit.attr); in thermal_remove_hwmon_sysfs()
239 list_del(&temp->hwmon_node); in thermal_remove_hwmon_sysfs()
240 kfree(temp); in thermal_remove_hwmon_sysfs()