summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/thermal_core.c')
-rw-r--r--drivers/thermal/thermal_core.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 96349ba59725..90e38cc199f4 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1358,12 +1358,9 @@ thermal_zone_device_register(const char *type, int trips, int mask,
goto release_device;
for (count = 0; count < trips; count++) {
- if (tz->ops->get_trip_type(tz, count, &trip_type))
- set_bit(count, &tz->trips_disabled);
- if (tz->ops->get_trip_temp(tz, count, &trip_temp))
- set_bit(count, &tz->trips_disabled);
- /* Check for bogus trip points */
- if (trip_temp == 0)
+ if (tz->ops->get_trip_type(tz, count, &trip_type) ||
+ tz->ops->get_trip_temp(tz, count, &trip_temp) ||
+ !trip_temp)
set_bit(count, &tz->trips_disabled);
}