PCI: armada8k: Check the return value from clk_prepare_enable()
PATCH v2 1/1 PCI: armada8k: Check the return value from clk_prepare_enable()
From: Fabio Estevam <[email protected]>
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 <[email protected]>
---
Changes since v1:
- Improve Subject style
drivers/pci/dwc/pcie-armada8k.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/dwc/pcie-armada8k.c +3 -1
@@ -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" );
Signature · 1 line
2.7.4
Hello,
Quoted 6 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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 <[email protected]>
Acked-by Thomas Petazzoni <[email protected]>
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
Quoted 6 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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 <[email protected]>
Applied with Thomas' ack to pci/host-armada for v4.14, thanks!
Quoted 25 lines
---
Changes since v1:
- Improve Subject styledrivers/pci/dwc/pcie-armada8k.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pci/dwc/pcie-armada8k.c +3
-1@@ -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" );Signature · 1 line
2.7.4