From: Jiasheng Jiang <jiashengjiangcool@gmail.com>
To: hverkuil@xs4all.nl
Cc: mchehab@kernel.org, andrzejtp2010@gmail.com,
allen.lkml@gmail.com, neil.armstrong@linaro.org,
quic_jjohnson@quicinc.com, lkundrak@v3.sk,
sakari.ailus@linux.intel.com, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jiasheng Jiang <jiashengjiangcool@gmail.com>
Subject: [PATCH v2] media: marvell: Add check for clk_enable()
Date: Tue, 3 Dec 2024 21:29:02 +0000 [thread overview]
Message-ID: <20241203212902.38116-1-jiashengjiangcool@gmail.com> (raw)
Add check for the return value of clk_enable() to gurantee the success.
Fixes: 81a409bfd551 ("media: marvell-ccic: provide a clock for the sensor")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
Changelog:
v1 -> v2:
1. Add pm_runtime_put().
---
drivers/media/platform/marvell/mcam-core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/marvell/mcam-core.c b/drivers/media/platform/marvell/mcam-core.c
index 9ec01228f907..b8360d37000a 100644
--- a/drivers/media/platform/marvell/mcam-core.c
+++ b/drivers/media/platform/marvell/mcam-core.c
@@ -935,7 +935,12 @@ static int mclk_enable(struct clk_hw *hw)
ret = pm_runtime_resume_and_get(cam->dev);
if (ret < 0)
return ret;
- clk_enable(cam->clk[0]);
+ ret = clk_enable(cam->clk[0]);
+ if (ret) {
+ pm_runtime_put(cam->dev);
+ return ret;
+ }
+
mcam_reg_write(cam, REG_CLKCTRL, (mclk_src << 29) | mclk_div);
mcam_ctlr_power_up(cam);
--
2.25.1
next reply other threads:[~2024-12-03 21:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 21:29 Jiasheng Jiang [this message]
2024-12-04 16:00 ` Markus Elfring
2024-12-05 8:52 ` Sakari Ailus
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=20241203212902.38116-1-jiashengjiangcool@gmail.com \
--to=jiashengjiangcool@gmail.com \
--cc=allen.lkml@gmail.com \
--cc=andrzejtp2010@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lkundrak@v3.sk \
--cc=mchehab@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_jjohnson@quicinc.com \
--cc=sakari.ailus@linux.intel.com \
/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®