summaryrefslogtreecommitdiff
path: root/drivers/pci/dwc
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2017-07-22 17:25:19 -0300
committerBjorn Helgaas <bhelgaas@google.com>2017-08-03 17:01:55 -0500
commite2e5d7bf9ba68e2ed0c70e10892472a8dd9ed9c2 (patch)
tree86bb25e899f1fbf2872204d3bb82c5dd7ac6dbff /drivers/pci/dwc
parent16f73eb02d7e1765ccab3d2018e0bd98eb93d973 (diff)
PCI: armada8k: Check the return value from clk_prepare_enable()
clk_prepare_enable() may fail, so check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'drivers/pci/dwc')
-rw-r--r--drivers/pci/dwc/pcie-armada8k.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pci/dwc/pcie-armada8k.c b/drivers/pci/dwc/pcie-armada8k.c
index ea8f34af6a85..729722366c63 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");