PCI: armada8k: Check the return value from clk_prepare_enable()
authorFabio Estevam <fabio.estevam@nxp.com>
Sat, 22 Jul 2017 20:25:19 +0000 (17:25 -0300)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 3 Aug 2017 22:01:55 +0000 (17:01 -0500)
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>
drivers/pci/dwc/pcie-armada8k.c

index ea8f34a..7297223 100644 (file)
@@ -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");