Thread (22 messages) flat view 22 messages, 6 authors, 2016-06-06

Re: [RFC PATCH v1 4/6] PM / devfreq: event: support rockchip dfi controller

From: hl <hidden>
Date: 2016-06-06 06:19:26
Also in: dri-devel, linux-arm-kernel, linux-rockchip, lkml

Hi Thierry,

On 2016年06月04日 00:54, Thierry Reding wrote:
On Fri, Jun 03, 2016 at 05:55:17PM +0800, Lin Huang wrote:
[...]
quoted
+	ret = clk_prepare_enable(data->clk);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to enable clk: %d\n", ret);
+		clk_disable_unprepare(data->clk);
+		return ret;
+	}
This is going to give you a large WARN. clk_prepare_enable() already
leaves the clock in a proper state when it fails (i.e. it calls
clk_unprepare() if the clk_enable() part failed), so calling
clk_disable_unprepare() upon failure is going to unbalance the
reference counts.
Thanks for reminding, i will fix it next version.
Thierry
-- 
Lin Huang

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