summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/imx8mm_thermal.c
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2020-12-02 20:24:47 -0300
committerDaniel Lezcano <daniel.lezcano@linaro.org>2020-12-04 20:46:03 +0100
commitce662ccde5c6ae4f4d89fe71570bf59441004eb9 (patch)
tree4a33442446672634ff67169622ef170de04a2150 /drivers/thermal/imx8mm_thermal.c
parent1b57b9597c779f0a20c5837abec31f600240496b (diff)
downloadlinux-ce662ccde5c6ae4f4d89fe71570bf59441004eb9.tar.gz
linux-ce662ccde5c6ae4f4d89fe71570bf59441004eb9.tar.bz2
linux-ce662ccde5c6ae4f4d89fe71570bf59441004eb9.zip
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
Diffstat (limited to 'drivers/thermal/imx8mm_thermal.c')
-rw-r--r--drivers/thermal/imx8mm_thermal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index a1e4f9bb4cb0..ce7cb6452c52 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -166,10 +166,11 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
&tmu->sensors[i],
&tmu_tz_ops);
if (IS_ERR(tmu->sensors[i].tzd)) {
+ ret = PTR_ERR(tmu->sensors[i].tzd);
dev_err(&pdev->dev,
"failed to register thermal zone sensor[%d]: %d\n",
i, ret);
- return PTR_ERR(tmu->sensors[i].tzd);
+ return ret;
}
tmu->sensors[i].hw_id = i;
}