linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] thermal: imx8mm: Print the correct error code
@ 2020-12-02 23:24 Fabio Estevam
  2020-12-02 23:24 ` [PATCH 2/2] thermal: imx8mm: Disable the clock on probe failure Fabio Estevam
  2020-12-07 13:47 ` [thermal: thermal/next] thermal: imx8mm: Print the correct error code thermal-bot for Fabio Estevam
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2020-12-02 23:24 UTC (permalink / raw)
  To: daniel.lezcano; +Cc: Anson.Huang, linux-pm, Fabio Estevam

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] thermal: imx8mm: Disable the clock on probe failure
  2020-12-02 23:24 [PATCH 1/2] thermal: imx8mm: Print the correct error code Fabio Estevam
@ 2020-12-02 23:24 ` Fabio Estevam
  2020-12-07 13:47   ` [thermal: thermal/next] " thermal-bot for Fabio Estevam
  2020-12-07 13:47 ` [thermal: thermal/next] thermal: imx8mm: Print the correct error code thermal-bot for Fabio Estevam
  1 sibling, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2020-12-02 23:24 UTC (permalink / raw)
  To: daniel.lezcano; +Cc: Anson.Huang, linux-pm, Fabio Estevam

Prior to returning an error in probe, disable the previously
enabled clock.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/thermal/imx8mm_thermal.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index ce7cb6452c52..7442e013738f 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -170,7 +170,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev,
 				"failed to register thermal zone sensor[%d]: %d\n",
 				i, ret);
-			return ret;
+			goto disable_clk;
 		}
 		tmu->sensors[i].hw_id = i;
 	}
@@ -185,6 +185,10 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
 	imx8mm_tmu_enable(tmu, true);
 
 	return 0;
+
+disable_clk:
+	clk_disable_unprepare(tmu->clk);
+	return ret;
 }
 
 static int imx8mm_tmu_remove(struct platform_device *pdev)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [thermal: thermal/next] thermal: imx8mm: Disable the clock on probe failure
  2020-12-02 23:24 ` [PATCH 2/2] thermal: imx8mm: Disable the clock on probe failure Fabio Estevam
@ 2020-12-07 13:47   ` thermal-bot for Fabio Estevam
  0 siblings, 0 replies; 4+ messages in thread
From: thermal-bot for Fabio Estevam @ 2020-12-07 13:47 UTC (permalink / raw)
  To: linux-pm; +Cc: Fabio Estevam, Daniel Lezcano, rui.zhang, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     e57eb8b5050c9b6d63eea26b194d96744fe4018a
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//e57eb8b5050c9b6d63eea26b194d96744fe4018a
Author:        Fabio Estevam <festevam@gmail.com>
AuthorDate:    Wed, 02 Dec 2020 20:24:48 -03:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Fri, 04 Dec 2020 20:46:03 +01:00

thermal: imx8mm: Disable the clock on probe failure

Prior to returning an error in probe, disable the previously
enabled clock.

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-2-festevam@gmail.com
---
 drivers/thermal/imx8mm_thermal.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index ce7cb64..7442e01 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -170,7 +170,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev,
 				"failed to register thermal zone sensor[%d]: %d\n",
 				i, ret);
-			return ret;
+			goto disable_clk;
 		}
 		tmu->sensors[i].hw_id = i;
 	}
@@ -185,6 +185,10 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
 	imx8mm_tmu_enable(tmu, true);
 
 	return 0;
+
+disable_clk:
+	clk_disable_unprepare(tmu->clk);
+	return ret;
 }
 
 static int imx8mm_tmu_remove(struct platform_device *pdev)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [thermal: thermal/next] thermal: imx8mm: Print the correct error code
  2020-12-02 23:24 [PATCH 1/2] thermal: imx8mm: Print the correct error code Fabio Estevam
  2020-12-02 23:24 ` [PATCH 2/2] thermal: imx8mm: Disable the clock on probe failure Fabio Estevam
@ 2020-12-07 13:47 ` thermal-bot for Fabio Estevam
  1 sibling, 0 replies; 4+ messages in thread
From: thermal-bot for Fabio Estevam @ 2020-12-07 13:47 UTC (permalink / raw)
  To: linux-pm; +Cc: Fabio Estevam, Daniel Lezcano, rui.zhang, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     ce662ccde5c6ae4f4d89fe71570bf59441004eb9
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//ce662ccde5c6ae4f4d89fe71570bf59441004eb9
Author:        Fabio Estevam <festevam@gmail.com>
AuthorDate:    Wed, 02 Dec 2020 20:24:47 -03:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Fri, 04 Dec 2020 20:46:03 +01:00

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
---
 drivers/thermal/imx8mm_thermal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index a1e4f9b..ce7cb64 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;
 	}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-07 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-02 23:24 [PATCH 1/2] thermal: imx8mm: Print the correct error code Fabio Estevam
2020-12-02 23:24 ` [PATCH 2/2] thermal: imx8mm: Disable the clock on probe failure Fabio Estevam
2020-12-07 13:47   ` [thermal: thermal/next] " thermal-bot for Fabio Estevam
2020-12-07 13:47 ` [thermal: thermal/next] thermal: imx8mm: Print the correct error code thermal-bot for Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).