Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Wu Bo <bo.wu@vivo.com>
Cc: linux-kernel@vger.kernel.org,
	"Pratyush Anand" <pratyush.anand@gmail.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, "Wu Bo" <wubo.oduw@gmail.com>
Subject: Re: [PATCH] PCI: dwc: change to use devm_clk_get_enabled() helpers
Date: Fri, 23 Aug 2024 16:56:29 -0500	[thread overview]
Message-ID: <20240823215629.GA387603@bhelgaas> (raw)
In-Reply-To: <20240823012516.1972826-1-bo.wu@vivo.com>

This is spear13xx-specific, not a generic dwc change, so the subject
should be:

  PCI: spear13xx: <Capitalized> ...

On Thu, Aug 22, 2024 at 07:25:16PM -0600, Wu Bo wrote:

Include the fact that you're using devm_clk_get_enabled() here so the
commit log is complete even without the subject line.

> Make the code cleaner and avoid call clk_disable_unprepare()
> 
> Signed-off-by: Wu Bo <bo.wu@vivo.com>
> ---
>  drivers/pci/controller/dwc/pcie-spear13xx.c | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-spear13xx.c b/drivers/pci/controller/dwc/pcie-spear13xx.c
> index 201dced209f0..37d9ccffc2e6 100644
> --- a/drivers/pci/controller/dwc/pcie-spear13xx.c
> +++ b/drivers/pci/controller/dwc/pcie-spear13xx.c
> @@ -221,32 +221,18 @@ static int spear13xx_pcie_probe(struct platform_device *pdev)
>  
>  	phy_init(spear13xx_pcie->phy);
>  
> -	spear13xx_pcie->clk = devm_clk_get(dev, NULL);
> +	spear13xx_pcie->clk = devm_clk_get_enabled(dev, NULL);
>  	if (IS_ERR(spear13xx_pcie->clk)) {
>  		dev_err(dev, "couldn't get clk for pcie\n");
>  		return PTR_ERR(spear13xx_pcie->clk);
>  	}
> -	ret = clk_prepare_enable(spear13xx_pcie->clk);
> -	if (ret) {
> -		dev_err(dev, "couldn't enable clk for pcie\n");
> -		return ret;
> -	}
>  
>  	if (of_property_read_bool(np, "st,pcie-is-gen1"))
>  		pci->link_gen = 1;
>  
>  	platform_set_drvdata(pdev, spear13xx_pcie);
>  
> -	ret = spear13xx_add_pcie_port(spear13xx_pcie, pdev);
> -	if (ret < 0)
> -		goto fail_clk;
> -
> -	return 0;
> -
> -fail_clk:
> -	clk_disable_unprepare(spear13xx_pcie->clk);
> -
> -	return ret;
> +	return spear13xx_add_pcie_port(spear13xx_pcie, pdev);

Nice cleanup, I like it.

>  }
>  
>  static const struct of_device_id spear13xx_pcie_of_match[] = {
> -- 
> 2.25.1
> 

      reply	other threads:[~2024-08-23 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23  1:25 [PATCH] PCI: dwc: change to use devm_clk_get_enabled() helpers Wu Bo
2024-08-23 21:56 ` Bjorn Helgaas [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=20240823215629.GA387603@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=bo.wu@vivo.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=pratyush.anand@gmail.com \
    --cc=robh@kernel.org \
    --cc=wubo.oduw@gmail.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