Thread (23 messages) 23 messages, 9 authors, 2014-01-17
STALE4511d
Revisions (9)
  1. v1 [diff vs current]
  2. v1 current
  3. v1 [diff vs current]
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v1 [diff vs current]
  7. v1 [diff vs current]
  8. v1 [diff vs current]
  9. v1 [diff vs current]

[PATCH 3/4] thermal: rcar: Add missing clock handling

From: Sergei Shtylyov <hidden>
Date: 2014-01-07 20:04:04
Also in: linux-pm, linux-sh

Hello.

On 07-01-2014 22:57, Geert Uytterhoeven wrote:
From: Geert Uytterhoeven <redacted>
When using DT to instantiate the rcar-thermal device, it prints the
following error:
     rcar_thermal e61f0000.thermal: thermal sensor was broken
Explicitly request and enable the thermal clock to fix this.
Signed-off-by: Geert Uytterhoeven <redacted>
---
  drivers/thermal/rcar_thermal.c |   40 +++++++++++++++++++++++++++++++++-------
  1 file changed, 33 insertions(+), 7 deletions(-)
quoted hunk ↗ jump to hunk
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 88f92e1a9944..a5629500723a 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
[...]
quoted hunk ↗ jump to hunk
@@ -378,23 +380,38 @@ static int rcar_thermal_probe(struct platform_device *pdev)
[...]
+	ret = clk_prepare(common->clk);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "unable to prepare clock\n");
+		return ret;
+	}
+
+	clk_enable(common->clk);
+
    Why not just clk_prepare_enable()?

[...]
quoted hunk ↗ jump to hunk
@@ -465,9 +484,13 @@ error_unregister:
  			rcar_thermal_irq_disable(priv);
  	}

+error_unpm:
  	pm_runtime_put_sync(dev);
  	pm_runtime_disable(dev);

+	clk_disable(common->clk);
+	clk_unprepare(common->clk);
+
    Why not just clk_disable_unprepare()?
quoted hunk ↗ jump to hunk
  	return ret;
  }
@@ -486,6 +509,9 @@ static int rcar_thermal_remove(struct platform_device *pdev)
  	pm_runtime_put_sync(dev);
  	pm_runtime_disable(dev);

+	clk_disable(common->clk);
+	clk_unprepare(common->clk);
+
    Likewise.

WBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help