linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: fix a missing check of clk_prepare
@ 2018-12-26  2:43 Kangjie Lu
  2018-12-27  9:43 ` Linus Walleij
  2019-01-22 18:02 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Kangjie Lu @ 2018-12-26  2:43 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Linus Walleij, Alessandro Zummo, Alexandre Belloni,
	linux-arm-kernel, linux-rtc, linux-kernel

clk_prepare() could fail, so let's check its status and if it fails
return its error code upstream.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/rtc/rtc-coh901331.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c
index fc5cf5c44ae7..0b232c84f674 100644
--- a/drivers/rtc/rtc-coh901331.c
+++ b/drivers/rtc/rtc-coh901331.c
@@ -235,9 +235,13 @@ static int coh901331_suspend(struct device *dev)
 
 static int coh901331_resume(struct device *dev)
 {
+	int ret;
 	struct coh901331_port *rtap = dev_get_drvdata(dev);
 
-	clk_prepare(rtap->clk);
+	ret = clk_prepare(rtap->clk);
+	if (ret)
+		return ret;
+
 	if (device_may_wakeup(dev)) {
 		disable_irq_wake(rtap->irq);
 	} else {
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-22 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26  2:43 [PATCH] rtc: fix a missing check of clk_prepare Kangjie Lu
2018-12-27  9:43 ` Linus Walleij
2019-01-22 18:02 ` Alexandre Belloni

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).