summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2018-12-25 20:43:33 -0600
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-01-22 19:01:19 +0100
commit5910fa0d0d9809c4d8fbf1fb905a8c86fbf2eccb (patch)
tree8ea1ba19b57dc4ea23dfc9d34eec158b661278e6 /drivers/rtc
parentbbb4383826b20cdc9efbd8ffdd19a5fa58320175 (diff)
rtc: coh901331: fix a missing check of clk_prepare
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> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-coh901331.c6
1 files changed, 5 insertions, 1 deletions
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 {