diff options
Diffstat (limited to 'drivers/thermal/ti-soc-thermal/ti-bandgap.c')
-rw-r--r-- | drivers/thermal/ti-soc-thermal/ti-bandgap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index 9dfd47196e63..74c0e3474d6e 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c | |||
@@ -1020,9 +1020,13 @@ int ti_bandgap_get_trend(struct ti_bandgap *bgp, int id, int *trend) | |||
1020 | 1020 | ||
1021 | /* Fetch the update interval */ | 1021 | /* Fetch the update interval */ |
1022 | ret = ti_bandgap_read_update_interval(bgp, id, &interval); | 1022 | ret = ti_bandgap_read_update_interval(bgp, id, &interval); |
1023 | if (ret || !interval) | 1023 | if (ret) |
1024 | goto unfreeze; | 1024 | goto unfreeze; |
1025 | 1025 | ||
1026 | /* Set the interval to 1 ms if bandgap counter delay is not set */ | ||
1027 | if (interval == 0) | ||
1028 | interval = 1; | ||
1029 | |||
1026 | *trend = (t1 - t2) / interval; | 1030 | *trend = (t1 - t2) / interval; |
1027 | 1031 | ||
1028 | dev_dbg(bgp->dev, "The temperatures are t1 = %d and t2 = %d and trend =%d\n", | 1032 | dev_dbg(bgp->dev, "The temperatures are t1 = %d and t2 = %d and trend =%d\n", |