mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] phy: ti-pipe3: make clk operations symmetric in probe and remove
Date: Wed, 4 Dec 2019 14:32:31 +0200	[thread overview]
Message-ID: <2dd4749d-edca-3b63-4804-d51b13f3724d@ti.com> (raw)
In-Reply-To: <20191204114759.3754-1-hslester96@gmail.com>



On 04/12/2019 13:47, Chuhong Yuan wrote:
> The driver calls clk_prepare_enable in probe but the corresponding
> clk_disable_unprepare() is in ti_pipe3_disable_clocks().
> Move clk_disable_unprepare() to remove to make them symmetric.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>

Acked-by: Roger Quadros <rogerq@ti.com>

> ---
> Changes in v2:
>    - Modify commit message.
>    - Delete the clk_disable_unprepare() in ti_pipe3_disable_clocks().
> 
>   drivers/phy/ti/phy-ti-pipe3.c | 18 +++++++-----------
>   1 file changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/phy/ti/phy-ti-pipe3.c b/drivers/phy/ti/phy-ti-pipe3.c
> index edd6859afba8..a87946589eb7 100644
> --- a/drivers/phy/ti/phy-ti-pipe3.c
> +++ b/drivers/phy/ti/phy-ti-pipe3.c
> @@ -850,6 +850,12 @@ static int ti_pipe3_probe(struct platform_device *pdev)
>   
>   static int ti_pipe3_remove(struct platform_device *pdev)
>   {
> +	struct ti_pipe3 *phy = platform_get_drvdata(pdev);
> +
> +	if (phy->mode == PIPE3_MODE_SATA) {
> +		clk_disable_unprepare(phy->refclk);
> +		phy->sata_refclk_enabled = false;
> +	}
>   	pm_runtime_disable(&pdev->dev);
>   
>   	return 0;
> @@ -900,18 +906,8 @@ static void ti_pipe3_disable_clocks(struct ti_pipe3 *phy)
>   {
>   	if (!IS_ERR(phy->wkupclk))
>   		clk_disable_unprepare(phy->wkupclk);
> -	if (!IS_ERR(phy->refclk)) {
> +	if (!IS_ERR(phy->refclk))
>   		clk_disable_unprepare(phy->refclk);
> -		/*
> -		 * SATA refclk needs an additional disable as we left it
> -		 * on in probe to avoid Errata i783
> -		 */
> -		if (phy->sata_refclk_enabled) {
> -			clk_disable_unprepare(phy->refclk);
> -			phy->sata_refclk_enabled = false;
> -		}
> -	}
> -
>   	if (!IS_ERR(phy->div_clk))
>   		clk_disable_unprepare(phy->div_clk);
>   }
> 

-- 
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

      reply	other threads:[~2019-12-04 12:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 11:47 Chuhong Yuan
2019-12-04 12:32 ` 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=2dd4749d-edca-3b63-4804-d51b13f3724d@ti.com \
    --to=rogerq@ti.com \
    --cc=hslester96@gmail.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 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®