From: Mingwei Zheng <zmw12306@gmail.com>
To: alexandre.belloni@bootlin.com, anson.huang@nxp.com
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
Mingwei Zheng <zmw12306@gmail.com>,
Jiasheng Jiang <jiashengjiangcool@gmail.com>
Subject: [PATCH] rtc: snvs: Add check for clk_enable()
Date: Sun, 15 Dec 2024 17:28:24 -0500 [thread overview]
Message-ID: <20241215222824.147575-1-zmw12306@gmail.com> (raw)
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: edb190cb1734 ("rtc: snvs: make sure clock is enabled for interrupt handle")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
drivers/rtc/rtc-snvs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index d82acf1af1fa..62af750e5751 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -281,8 +281,11 @@ static irqreturn_t snvs_rtc_irq_handler(int irq, void *dev_id)
struct snvs_rtc_data *data = dev_get_drvdata(dev);
u32 lpsr;
u32 events = 0;
+ int ret;
- clk_enable(data->clk);
+ ret = clk_enable(data->clk);
+ if (ret)
+ return IRQ_NONE;
regmap_read(data->regmap, data->offset + SNVS_LPSR, &lpsr);
--
2.34.1
reply other threads:[~2024-12-15 22:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20241215222824.147575-1-zmw12306@gmail.com \
--to=zmw12306@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=anson.huang@nxp.com \
--cc=jiashengjiangcool@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/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
all inboxes | Powered by JetHome®