media: marvell: Add check for clk_enable()
Subsystems (2)
PATCH 1/1 media: marvell: Add check for clk_enable()
Add check for the return value of clk_enable() to gurantee the success.
--- drivers/media/platform/marvell/mcam-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/marvell/mcam-core.c +3 -1
@@ -935,7 +935,9 @@ 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) +return ret;mcam_reg_write (cam,REG_CLKCTRL , (mclk_src <<29 ) | mclk_div);mcam_ctlr_power_up (cam);
Signature · 1 line
2.25.1
Hi Jiasheng,
Quoted 13 lines · 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 <[email protected]>--- drivers/media/platform/marvell/mcam-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/media/platform/marvell/mcam-core.c +0
-0
drivers/media/platform/marvell/mcam-core.c static int mclk_enable(struct clk_hw *hw) · line 940
Quoted 7 lines
drivers/media/platform/marvell/mcam-core.c +3
-1@@ -935,7 +935,9 @@ 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) +return ret;
If clk_enable returns an error, doesn't this also require a call to pm_runtime_put() to balance the pm_runtime_resume_and_get() call?
Regards,
Hans
Quoted 3 lines
drivers/media/platform/marvell/mcam-core.c +0
-0mcam_reg_write (cam,REG_CLKCTRL , (mclk_src <<29 ) | mclk_div);mcam_ctlr_power_up (cam);
Hi Hans,
Quoted 12 lines · Hans Verkuil
Hi Jiasheng,
Quoted 8 lines · 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 <[email protected]>--- drivers/media/platform/marvell/mcam-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 15 lines
drivers/media/platform/marvell/mcam-core.c static int mclk_enable(struct clk_hw *hw) · line 940
Quoted 12 lines
drivers/media/platform/marvell/mcam-core.c +3
-1@@ -935,7 +935,9 @@ 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) +return ret;If
clk_enablereturns an error, doesn't this also require a call topm_runtime_put()to balance thepm_runtime_resume_and_get()call?
Thanks. I will submit a v2 to add error handling.
-Jiasheng
Quoted 8 lines
Regards,
Hans
Quoted 3 lines
drivers/media/platform/marvell/mcam-core.c +0
-0mcam_reg_write (cam,REG_CLKCTRL , (mclk_src <<29 ) | mclk_div);mcam_ctlr_power_up (cam);