Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal: imx8mm: Print the correct error code

Currently the error message does not print the correct error code.

Fix it by initializing 'ret' to the proper error code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201202232448.2692-1-festevam@gmail.com

authored by

Fabio Estevam and committed by
Daniel Lezcano
ce662ccd 1b57b959

+2 -1
+2 -1
drivers/thermal/imx8mm_thermal.c
··· 166 166 &tmu->sensors[i], 167 167 &tmu_tz_ops); 168 168 if (IS_ERR(tmu->sensors[i].tzd)) { 169 + ret = PTR_ERR(tmu->sensors[i].tzd); 169 170 dev_err(&pdev->dev, 170 171 "failed to register thermal zone sensor[%d]: %d\n", 171 172 i, ret); 172 - return PTR_ERR(tmu->sensors[i].tzd); 173 + return ret; 173 174 } 174 175 tmu->sensors[i].hw_id = i; 175 176 }