lkml.org 
[lkml]   [2021]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] PCI: mediatek: Verify whether the free_ck clock is ungated or not
Date
Verify that the free_ck clock is ungated on device resume
by checking return value of clk_prepare_enable().

Signed-off-by: Amey Narkhede <ameynarkhede03@gmail.com>
---
drivers/pci/controller/pcie-mediatek.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index 23548b517..9b13214bf 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -1154,11 +1154,14 @@ 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)
+ return ret;

list_for_each_entry_safe(port, tmp, &pcie->ports, list)
mtk_pcie_enable_port(port);
--
2.31.1
\
 
 \ /
  Last update: 2021-04-29 15:48    [W:0.063 / U:2.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site