mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>, kishon@ti.com
Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] phy: rcar-gen3-usb2: fix implementation for runtime PM
Date: Mon, 13 Mar 2017 12:04:25 +0300	[thread overview]
Message-ID: <5006ac8a-b989-fb74-77ee-d7f023c1d20f@cogentembedded.com> (raw)
In-Reply-To: <1489386258-31279-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>

Hello!

On 3/13/2017 9:24 AM, Yoshihiro Shimoda wrote:

> This patch fixes an issue that this driver doesn't take care of the runtime
> PM. This code assumed that devm_phy_create() called pm_runtime_enable(dev),
> but it misunderstood the dev_phy_create()'s specification.
> This driver should call the own pm_runtime_pm() before dev_phy_create().

    Its own?

> Fixes: f3b5a8d9b50d ("phy: rcar-gen3-usb2: Add R-Car Gen3 USB2 PHY driver")
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  drivers/phy/phy-rcar-gen3-usb2.c | 29 +++++++++++++++++++++++------
>  1 file changed, 23 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c
> index afb4d04..23c4e86 100644
> --- a/drivers/phy/phy-rcar-gen3-usb2.c
> +++ b/drivers/phy/phy-rcar-gen3-usb2.c
[...]
> @@ -454,15 +462,22 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
>  	provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
>  	if (IS_ERR(provider)) {
>  		dev_err(dev, "Failed to register PHY provider\n");
> +		ret = PTR_ERR(provider);
> +		goto error;
>  	} else if (channel->has_otg) {
>  		int ret;
>
>  		ret = device_create_file(dev, &dev_attr_role);
>  		if (ret < 0)
> -			return ret;
> +			goto error;
>  	}
>
>  	return PTR_ERR_OR_ZERO(provider);

    Here 'provider' can no longer contain error -- *return* 0 seems to fit better.

> +
> +error:
> +	pm_runtime_disable(dev);
> +
> +	return ret;
>  }
>
>  static int rcar_gen3_phy_usb2_remove(struct platform_device *pdev)
[...]

MBR, Sergei

  reply	other threads:[~2017-03-13  9:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13  6:24 Yoshihiro Shimoda
2017-03-13  9:04 ` Sergei Shtylyov [this message]
2017-03-13  9:38   ` Yoshihiro Shimoda

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=5006ac8a-b989-fb74-77ee-d7f023c1d20f@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.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

all inboxes | Powered by JetHome®