* [PATCH] rtc: Add check for clk_enable()
@ 2024-12-06 22:24 Mingwei Zheng
0 siblings, 0 replies; only message in thread
From: Mingwei Zheng @ 2024-12-06 22:24 UTC (permalink / raw)
To: alexandre.belloni, gxt, linus.walleij, haojian.zhuang, broonie, akpm
Cc: linux-rtc, linux-kernel, Mingwei Zheng, Jiasheng Jiang
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: 0c4eae66591a ("rtc: convert drivers/rtc/* to use module_platform_driver()")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
drivers/rtc/rtc-spear.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index 26eed927f8b3..064d46b2f16e 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -437,7 +437,7 @@ static int spear_rtc_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct spear_rtc_config *config = platform_get_drvdata(pdev);
- int irq;
+ int irq, ret;
irq = platform_get_irq(pdev, 0);
@@ -447,7 +447,9 @@ static int spear_rtc_resume(struct device *dev)
config->irq_wake = 0;
}
} else {
- clk_enable(config->clk);
+ ret = clk_enable(config->clk);
+ if (ret)
+ return ret;
spear_rtc_enable_interrupt(config);
}
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-12-06 22:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-06 22:24 [PATCH] rtc: Add check for clk_enable() Mingwei Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®