From: Roger Quadros <rogerq@ti.com>
To: Axel Lin <axel.lin@ingics.com>, Kishon Vijay Abraham I <kishon@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] phy: core: Fixup return value of phy_exit when !pm_runtime_enabled
Date: Fri, 6 Mar 2015 12:11:38 +0200 [thread overview]
Message-ID: <54F97D5A.60302@ti.com> (raw)
In-Reply-To: <1425628510.25002.1.camel@phoenix>
On 06/03/15 09:55, Axel Lin wrote:
> When phy_pm_runtime_get_sync() returns -ENOTSUPP, phy_exit() also returns
> -ENOTSUPP if !phy->ops->exit. Fix it.
> Also move the code to override ret close to the code we got ret.
> I think it is less error prone this way.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Roger Quadros <rogerq@ti.com>
cheers,
-roger
> ---
> drivers/phy/phy-core.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index a12d353..250dc6c 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -223,6 +223,7 @@ int phy_init(struct phy *phy)
> ret = phy_pm_runtime_get_sync(phy);
> if (ret < 0 && ret != -ENOTSUPP)
> return ret;
> + ret = 0; /* Override possible ret == -ENOTSUPP */
>
> mutex_lock(&phy->mutex);
> if (phy->init_count == 0 && phy->ops->init) {
> @@ -231,8 +232,6 @@ int phy_init(struct phy *phy)
> dev_err(&phy->dev, "phy init failed --> %d\n", ret);
> goto out;
> }
> - } else {
> - ret = 0; /* Override possible ret == -ENOTSUPP */
> }
> ++phy->init_count;
>
> @@ -253,6 +252,7 @@ int phy_exit(struct phy *phy)
> ret = phy_pm_runtime_get_sync(phy);
> if (ret < 0 && ret != -ENOTSUPP)
> return ret;
> + ret = 0; /* Override possible ret == -ENOTSUPP */
>
> mutex_lock(&phy->mutex);
> if (phy->init_count == 1 && phy->ops->exit) {
> @@ -287,6 +287,7 @@ int phy_power_on(struct phy *phy)
> ret = phy_pm_runtime_get_sync(phy);
> if (ret < 0 && ret != -ENOTSUPP)
> return ret;
> + ret = 0; /* Override possible ret == -ENOTSUPP */
>
> mutex_lock(&phy->mutex);
> if (phy->power_count == 0 && phy->ops->power_on) {
> @@ -295,8 +296,6 @@ int phy_power_on(struct phy *phy)
> dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
> goto out;
> }
> - } else {
> - ret = 0; /* Override possible ret == -ENOTSUPP */
> }
> ++phy->power_count;
> mutex_unlock(&phy->mutex);
>
prev parent reply other threads:[~2015-03-06 10:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 7:55 [PATCH] phy: core: Fixup return value of phy_exit when !pm_runtime_enabled Axel Lin
2015-03-06 10:11 ` Roger Quadros [this message]
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=54F97D5A.60302@ti.com \
--to=rogerq@ti.com \
--cc=axel.lin@ingics.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.