[PATCH v3 6/6] PCI: brcmstb: Check return value of clk_prepare_enable()

Jim Quinlan jim2101024 at gmail.com
Fri Mar 26 19:19:04 GMT 2021


The check was missing on PCIe resume.

Signed-off-by: Jim Quinlan <jim2101024 at gmail.com>
Acked-by: Florian Fainelli <f.fainelli at gmail.com>
Fixes: 8195b7417018 ("PCI: brcmstb: Add suspend and resume pm_ops")
---
 drivers/pci/controller/pcie-brcmstb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index 2d9288399014..f6d9d785b301 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1396,7 +1396,9 @@ static int brcm_pcie_resume(struct device *dev)
 	int ret;
 
 	base = pcie->base;
-	clk_prepare_enable(pcie->clk);
+	ret = clk_prepare_enable(pcie->clk);
+	if (ret)
+		return ret;
 
 	ret = brcm_set_regulators(pcie, TURN_ON);
 	if (ret)
@@ -1535,7 +1537,9 @@ static int brcm_pcie_probe(struct platform_device *pdev)
 
 	ret = brcm_pcie_get_regulators(pcie);
 	if (ret) {
-		dev_err(pcie->dev, "failed to get regulators (err=%d)\n", ret);
+		pcie->num_supplies = 0;
+		if (ret != -EPROBE_DEFER)
+			dev_err(pcie->dev, "failed to get regulators (err=%d)\n", ret);
 		goto fail;
 	}
 
-- 
2.17.1




More information about the linux-arm-kernel mailing list