]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: mipi-csis: Add check for clk_enable()
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Mon, 25 Nov 2024 19:18:18 +0000 (19:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:46:55 +0000 (12:46 +0100)
[ Upstream commit 125ad1aeec77eb55273b420be6894b284a01e4b6 ]

Add check for the return value of clk_enable() to gurantee the success.

Fixes: b5f1220d587d ("[media] v4l: Add v4l2 subdev driver for S5P/EXYNOS4 MIPI-CSI receivers")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/exynos4-is/mipi-csis.c

index ebf39c8568943085e27a878ce524091fbfb49009..e6c86ba30fa32d56152856db319dce4e9cbea497 100644 (file)
@@ -939,13 +939,19 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
                                               state->supplies);
                        goto unlock;
                }
-               clk_enable(state->clock[CSIS_CLK_GATE]);
+               ret = clk_enable(state->clock[CSIS_CLK_GATE]);
+               if (ret) {
+                       phy_power_off(state->phy);
+                       regulator_bulk_disable(CSIS_NUM_SUPPLIES,
+                                              state->supplies);
+                       goto unlock;
+               }
        }
        if (state->flags & ST_STREAMING)
                s5pcsis_start_stream(state);
 
        state->flags &= ~ST_SUSPENDED;
- unlock:
+unlock:
        mutex_unlock(&state->lock);
        return ret ? -EAGAIN : 0;
 }