diff options
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 5a648794b667..58cd68e9bc1c 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
@@ -311,9 +311,9 @@ static u32 get_th_reg(struct exynos_tmu_data *data, u32 threshold, bool falling) | |||
311 | const struct thermal_trip * const trips = | 311 | const struct thermal_trip * const trips = |
312 | of_thermal_get_trip_points(tz); | 312 | of_thermal_get_trip_points(tz); |
313 | unsigned long temp; | 313 | unsigned long temp; |
314 | int i; | 314 | int i, ntrips = min_t(int, of_thermal_get_ntrips(tz), data->ntrip); |
315 | 315 | ||
316 | for (i = 0; i < of_thermal_get_ntrips(tz); i++) { | 316 | for (i = 0; i < ntrips; i++) { |
317 | if (trips[i].type == THERMAL_TRIP_CRITICAL) | 317 | if (trips[i].type == THERMAL_TRIP_CRITICAL) |
318 | continue; | 318 | continue; |
319 | 319 | ||