* [PATCH v2] media: marvell: Add check for clk_enable()
@ 2024-12-03 21:29 Jiasheng Jiang
2024-12-04 16:00 ` Markus Elfring
2024-12-05 8:52 ` Sakari Ailus
0 siblings, 2 replies; 3+ messages in thread
From: Jiasheng Jiang @ 2024-12-03 21:29 UTC (permalink / raw)
To: hverkuil
Cc: mchehab, andrzejtp2010, allen.lkml, neil.armstrong,
quic_jjohnson, lkundrak, sakari.ailus, linux-media, linux-kernel,
Jiasheng Jiang
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] media: marvell: Add check for clk_enable()
2024-12-03 21:29 [PATCH v2] media: marvell: Add check for clk_enable() Jiasheng Jiang
@ 2024-12-04 16:00 ` Markus Elfring
2024-12-05 8:52 ` Sakari Ailus
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2024-12-04 16:00 UTC (permalink / raw)
To: Jiasheng Jiang, linux-media, Hans Verkuil
Cc: LKML, Allen Pais, Andrzej Pietrasiewicz, Jeff Johnson,
Lubomir Rintel, Mauro Carvalho Chehab, Neil Armstrong,
Sakari Ailus
> Add check for the return value of clk_enable() to gurantee the success.
guarantee?
Would you like to detect a failed function call?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] media: marvell: Add check for clk_enable()
2024-12-03 21:29 [PATCH v2] media: marvell: Add check for clk_enable() Jiasheng Jiang
2024-12-04 16:00 ` Markus Elfring
@ 2024-12-05 8:52 ` Sakari Ailus
1 sibling, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2024-12-05 8:52 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: hverkuil, mchehab, andrzejtp2010, allen.lkml, neil.armstrong,
quic_jjohnson, lkundrak, linux-media, linux-kernel
On Tue, Dec 03, 2024 at 09:29:02PM +0000, Jiasheng Jiang wrote:
> 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>
Thanks!
Applied, with spelling of "guarantee" addressed.
--
Sakari Ailus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-05 8:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-03 21:29 [PATCH v2] media: marvell: Add check for clk_enable() Jiasheng Jiang
2024-12-04 16:00 ` Markus Elfring
2024-12-05 8:52 ` Sakari Ailus
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®