linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PCI: mediatek: Check return value of clk_prepare_enable
@ 2021-04-30 15:54 Amey Narkhede
  0 siblings, 0 replies; only message in thread
From: Amey Narkhede @ 2021-04-30 15:54 UTC (permalink / raw)
  To: Ryder Lee
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Philipp Zabel,
	Matthias Brugger, linux-kernel, linux-pci, linux-mediatek,
	linux-arm-kernel, Amey Narkhede

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@gmail.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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-30 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30 15:54 [PATCH v2] PCI: mediatek: Check return value of clk_prepare_enable Amey Narkhede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).