[PATCH] cpu: imx8_cpu: Provide default temperatures
Andrew Goodbody
andrew.goodbody at linaro.org
Thu Jul 24 16:46:49 CEST 2025
Add setting default temperatures to the weak version of
get_cpu_temp_grade so these values will not be used uninitialised.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
drivers/cpu/imx8_cpu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c
index 4836bddd93b..950630453f9 100644
--- a/drivers/cpu/imx8_cpu.c
+++ b/drivers/cpu/imx8_cpu.c
@@ -201,6 +201,10 @@ static int cpu_imx_get_temp(struct cpu_imx_plat *plat)
__weak u32 get_cpu_temp_grade(int *minc, int *maxc)
{
+ if (minc && maxc) {
+ *minc = 0;
+ *maxc = 95;
+ }
return 0;
}
---
base-commit: 3532f1f5edfc97c9dcea723cdeb732eda44bc669
change-id: 20250724-imx8_cpu-33ede102f971
Best regards,
--
Andrew Goodbody <andrew.goodbody at linaro.org>
More information about the U-Boot
mailing list