From: Kangjie Lu <kjlu@umn.edu>
To: kjlu@umn.edu
Cc: pakki001@umn.edu, Linus Walleij <linus.walleij@linaro.org>,
Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] rtc: fix a missing check of clk_prepare
Date: Tue, 25 Dec 2018 20:43:33 -0600 [thread overview]
Message-ID: <20181226024333.72236-1-kjlu@umn.edu> (raw)
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)
next reply other threads:[~2018-12-26 2:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-26 2:43 Kangjie Lu [this message]
2018-12-27 9:43 ` [PATCH] rtc: fix a missing check of clk_prepare Linus Walleij
2019-01-22 18:02 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181226024333.72236-1-kjlu@umn.edu \
--to=kjlu@umn.edu \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=pakki001@umn.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).