Thread (6 messages) 6 messages, 5 authors, 2016-03-02

Re: [PATCH 1/2] i2c: xiic: Implement Power management

From: Shubhrajyoti Datta <hidden>
Date: 2016-03-02 05:27:42
Also in: linux-devicetree

On Tue, Mar 1, 2016 at 11:59 PM, Wolfram Sang [off-list ref] wrote:
quoted
+     ret = clk_prepare_enable(i2c->clk);
+     if (ret)
+             dev_err(&pdev->dev, "Unable to enable clock.\n");
Don't you want to bail out here? The clk refcounting will be messed up
if you continue.
Agree missed it will fix it.
quoted
+err_clk_dis:
+     clk_disable_unprepare(i2c->clk);
+     pm_runtime_set_suspended(&pdev->dev);
+     pm_runtime_disable(&pdev->dev);
+     return ret;
To match the inverse of the activation order, I'd put the
clk_disable_unprepare after the pm_* calls. Couldn't it happen that
those calls need to change the clk state?
makes sense will change in the next version
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help