]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: marvell: Add check for clk_enable()
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Tue, 3 Dec 2024 21:29:02 +0000 (21:29 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 19 Dec 2024 11:50:12 +0000 (12:50 +0100)
Add check for the return value of clk_enable() to guarantee the success.

Fixes: 81a409bfd551 ("media: marvell-ccic: provide a clock for the sensor")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
[Sakari Ailus: Fix spelling in commit message.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/marvell/mcam-core.c

index 9ec01228f907311f1034523f06a2704a3b70b902..b8360d37000a7d0714d28dc8c3cff0de67503fd3 100644 (file)
@@ -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);