diff options
Diffstat (limited to 'drivers/thermal/thermal_sys.c')
-rw-r--r-- | drivers/thermal/thermal_sys.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 713b7ea4a607..fc6f2a5bde01 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
@@ -560,7 +560,8 @@ thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz) | |||
560 | 560 | ||
561 | tz->hwmon = NULL; | 561 | tz->hwmon = NULL; |
562 | device_remove_file(hwmon->device, &tz->temp_input.attr); | 562 | device_remove_file(hwmon->device, &tz->temp_input.attr); |
563 | device_remove_file(hwmon->device, &tz->temp_crit.attr); | 563 | if (tz->ops->get_crit_temp) |
564 | device_remove_file(hwmon->device, &tz->temp_crit.attr); | ||
564 | 565 | ||
565 | mutex_lock(&thermal_list_lock); | 566 | mutex_lock(&thermal_list_lock); |
566 | list_del(&tz->hwmon_node); | 567 | list_del(&tz->hwmon_node); |