Skip to content

Commit 4881640

Browse files
konradybciodlezcano
authored andcommitted
thermal/of: Assume polling-delay(-passive) 0 when absent
Currently, thermal zones associated with providers that have interrupts for signaling hot/critical trips are required to set a polling-delay of 0 to indicate no polling. This feels a bit backwards. Change the code such that "no polling delay" also means "no polling". Suggested-by: Bjorn Andersson <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8d5d6ab commit 4881640

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/thermal/thermal_of.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,18 @@ static int thermal_of_monitor_init(struct device_node *np, int *delay, int *pdel
227227
int ret;
228228

229229
ret = of_property_read_u32(np, "polling-delay-passive", pdelay);
230-
if (ret < 0) {
231-
pr_err("%pOFn: missing polling-delay-passive property\n", np);
230+
if (ret == -EINVAL) {
231+
*pdelay = 0;
232+
} else if (ret < 0) {
233+
pr_err("%pOFn: Couldn't get polling-delay-passive: %d\n", np, ret);
232234
return ret;
233235
}
234236

235237
ret = of_property_read_u32(np, "polling-delay", delay);
236-
if (ret < 0) {
237-
pr_err("%pOFn: missing polling-delay property\n", np);
238+
if (ret == -EINVAL) {
239+
*delay = 0;
240+
} else if (ret < 0) {
241+
pr_err("%pOFn: Couldn't get polling-delay: %d\n", np, ret);
238242
return ret;
239243
}
240244

0 commit comments

Comments
 (0)