From: Wolfram Sang <wsa@the-dreams.de>
To: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Cc: linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
Shubhrajyoti Datta <shubhraj@xilinx.com>
Subject: Re: [PATCH 1/2] i2c: xiic: Implement Power management
Date: Tue, 1 Mar 2016 19:29:47 +0100 [thread overview]
Message-ID: <20160301182947.GB1488@katana> (raw)
In-Reply-To: <1451893834-1066-1-git-send-email-shubhraj@xilinx.com>
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
> + 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.
> +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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-03-01 18:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 7:50 [PATCH 1/2] i2c: xiic: Implement Power management Shubhrajyoti Datta
2016-01-04 7:50 ` [PATCH 2/2] bindings: i2c: Add clock entries for i2c-xiic Shubhrajyoti Datta
2016-01-04 14:18 ` Rob Herring
2016-01-20 9:07 ` Shubhrajyoti Datta
[not found] ` <1451893834-1066-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2016-01-20 9:11 ` [PATCH 1/2] i2c: xiic: Implement Power management Shubhrajyoti Datta
2016-03-01 18:29 ` Wolfram Sang [this message]
2016-03-02 5:27 ` Shubhrajyoti Datta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160301182947.GB1488@katana \
--to=wsa@the-dreams.de \
--cc=devicetree@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=shubhraj@xilinx.com \
--cc=shubhrajyoti.datta@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).