linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PCI: armada8k: Check the return value from clk_prepare_enable()
@ 2017-07-22 20:25 Fabio Estevam
  2017-07-22 20:31 ` Thomas Petazzoni
  2017-08-03 22:02 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2017-07-22 20:25 UTC (permalink / raw)
  To: bhelgaas; +Cc: thomas.petazzoni, linux-pci, Fabio Estevam

From: Fabio Estevam <fabio.estevam@nxp.com>

clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v1:
- Improve Subject style

 drivers/pci/dwc/pcie-armada8k.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/dwc/pcie-armada8k.c b/drivers/pci/dwc/pcie-armada8k.c
index ea8f34a..7297223 100644
--- a/drivers/pci/dwc/pcie-armada8k.c
+++ b/drivers/pci/dwc/pcie-armada8k.c
@@ -226,7 +226,9 @@ static int armada8k_pcie_probe(struct platform_device *pdev)
 	if (IS_ERR(pcie->clk))
 		return PTR_ERR(pcie->clk);
 
-	clk_prepare_enable(pcie->clk);
+	ret = clk_prepare_enable(pcie->clk);
+	if (ret)
+		return ret;
 
 	/* Get the dw-pcie unit configuration/control registers base. */
 	base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] PCI: armada8k: Check the return value from clk_prepare_enable()
  2017-07-22 20:25 [PATCH v2] PCI: armada8k: Check the return value from clk_prepare_enable() Fabio Estevam
@ 2017-07-22 20:31 ` Thomas Petazzoni
  2017-08-03 22:02 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2017-07-22 20:31 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: bhelgaas, linux-pci, Fabio Estevam

Hello,

On Sat, 22 Jul 2017 17:25:19 -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> clk_prepare_enable() may fail, so we should better check its return value
> and propagate it in the case of error.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] PCI: armada8k: Check the return value from clk_prepare_enable()
  2017-07-22 20:25 [PATCH v2] PCI: armada8k: Check the return value from clk_prepare_enable() Fabio Estevam
  2017-07-22 20:31 ` Thomas Petazzoni
@ 2017-08-03 22:02 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2017-08-03 22:02 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: bhelgaas, thomas.petazzoni, linux-pci, Fabio Estevam

On Sat, Jul 22, 2017 at 05:25:19PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> clk_prepare_enable() may fail, so we should better check its return value
> and propagate it in the case of error.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Applied with Thomas' ack to pci/host-armada for v4.14, thanks!

> ---
> Changes since v1:
> - Improve Subject style
> 
>  drivers/pci/dwc/pcie-armada8k.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/dwc/pcie-armada8k.c b/drivers/pci/dwc/pcie-armada8k.c
> index ea8f34a..7297223 100644
> --- a/drivers/pci/dwc/pcie-armada8k.c
> +++ b/drivers/pci/dwc/pcie-armada8k.c
> @@ -226,7 +226,9 @@ static int armada8k_pcie_probe(struct platform_device *pdev)
>  	if (IS_ERR(pcie->clk))
>  		return PTR_ERR(pcie->clk);
>  
> -	clk_prepare_enable(pcie->clk);
> +	ret = clk_prepare_enable(pcie->clk);
> +	if (ret)
> +		return ret;
>  
>  	/* Get the dw-pcie unit configuration/control registers base. */
>  	base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl");
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-03 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-22 20:25 [PATCH v2] PCI: armada8k: Check the return value from clk_prepare_enable() Fabio Estevam
2017-07-22 20:31 ` Thomas Petazzoni
2017-08-03 22:02 ` Bjorn Helgaas

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).