[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160603165426.GC21013@ulmo.ba.sec>
Date: Fri, 3 Jun 2016 18:54:26 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Lin Huang <hl@...k-chips.com>
Cc: heiko@...ech.de, mark.yao@...k-chips.com, myungjoo.ham@...sung.com,
mturquette@...libre.com, sboyd@...eaurora.org,
linux-clk@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, airlied@...ux.ie,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
kyungmin.park@...sung.com, dianders@...omium.org,
dbasehore@...omium.org, huangtao@...k-chips.com, typ@...k-chips.com
Subject: Re: [RFC PATCH v1 4/6] PM / devfreq: event: support rockchip dfi
controller
On Fri, Jun 03, 2016 at 05:55:17PM +0800, Lin Huang wrote:
[...]
> + 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.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists