From: Mingwei Zheng <zmw12306@gmail.com>
To: alexandre.belloni@bootlin.com, gxt@mprc.pku.edu.cn,
linus.walleij@linaro.org, haojian.zhuang@gmail.com,
broonie@opensource.wolfsonmicro.com, akpm@linux-foundation.org
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
Mingwei Zheng <zmw12306@gmail.com>,
Jiasheng Jiang <jiashengjiangcool@gmail.com>
Subject: [PATCH] rtc: Add check for clk_enable()
Date: Fri, 6 Dec 2024 17:24:52 -0500 [thread overview]
Message-ID: <20241206222452.3479786-1-zmw12306@gmail.com> (raw)
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
reply other threads:[~2024-12-06 22:21 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=20241206222452.3479786-1-zmw12306@gmail.com \
--to=zmw12306@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexandre.belloni@bootlin.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gxt@mprc.pku.edu.cn \
--cc=haojian.zhuang@gmail.com \
--cc=jiashengjiangcool@gmail.com \
--cc=linus.walleij@linaro.org \
--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®