diff mbox series

[1/2] thermal: imx8mm: Print the correct error code

Message ID 20201202232448.2692-1-festevam@gmail.com (mailing list archive)
State New, archived
Delegated to: Daniel Lezcano
Headers show
Series [1/2] thermal: imx8mm: Print the correct error code | expand

Commit Message

Fabio Estevam Dec. 2, 2020, 11:24 p.m. UTC
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>
---
 drivers/thermal/imx8mm_thermal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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;
 	}