[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210430155429.35034-1-ameynarkhede03@gmail.com>
Date: Fri, 30 Apr 2021 21:24:29 +0530
From: Amey Narkhede <ameynarkhede03@...il.com>
To: Ryder Lee <ryder.lee@...iatek.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Matthias Brugger <matthias.bgg@...il.com>,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
Amey Narkhede <ameynarkhede03@...il.com>
Subject: [PATCH v2] PCI: mediatek: Check return value of clk_prepare_enable
In case when free_ck clock is not enabled during device resume
check the return value of clk_prepare_enable() and return the
error after printing it.
Signed-off-by: Amey Narkhede <ameynarkhede03@...il.com>
---
Changes in v2:
- Print the error before returning
- Clarify commit log
drivers/pci/controller/pcie-mediatek.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index 23548b517..9bdae34cc 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -1154,11 +1154,16 @@ static int __maybe_unused mtk_pcie_resume_noirq(struct device *dev)
{
struct mtk_pcie *pcie = dev_get_drvdata(dev);
struct mtk_pcie_port *port, *tmp;
+ int ret;
if (list_empty(&pcie->ports))
return 0;
- clk_prepare_enable(pcie->free_ck);
+ ret = clk_prepare_enable(pcie->free_ck);
+ if (ret) {
+ dev_err(dev, "Failed to enable free_ck clock\n");
+ return ret;
+ }
list_for_each_entry_safe(port, tmp, &pcie->ports, list)
mtk_pcie_enable_port(port);
--
2.31.1
Powered by blists - more mailing lists