Check clock-enable failures during probe.
If a later clock cannot be enabled, unwind clocks already enabled on
that path before returning the error.
Signed-off-by: jiawen <1298662399@qq.com>
---
diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -1297,8 +1297,15 @@
if (ret)
return ret;
- clk_prepare_enable(dmc->fout_bpll);
- clk_prepare_enable(dmc->mout_bpll);
+ ret = clk_prepare_enable(dmc->fout_bpll);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare_enable(dmc->mout_bpll);
+ if (ret) {
+ clk_disable_unprepare(dmc->fout_bpll);
+ return ret;
+ }
/*
* Some bootloaders do not set clock routes correctly.
On 8/18/26 14:19, Jiawen Liu wrote:
> Check clock-enable failures during probe.
>
> If a later clock cannot be enabled, unwind clocks already enabled on
> that path before returning the error.
>
> Signed-off-by: jiawen <1298662399@qq.com>
> ---
> diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
> --- a/drivers/memory/samsung/exynos5422-dmc.c
> +++ b/drivers/memory/samsung/exynos5422-dmc.c
> @@ -1297,8 +1297,15 @@
> if (ret)
> return ret;
>
> - clk_prepare_enable(dmc->fout_bpll);
> - clk_prepare_enable(dmc->mout_bpll);
> + ret = clk_prepare_enable(dmc->fout_bpll);
> + if (ret)
> + return ret;
> +
> + ret = clk_prepare_enable(dmc->mout_bpll);
> + if (ret) {
> + clk_disable_unprepare(dmc->fout_bpll);
> + return ret;
> + }
>
> /*
> * Some bootloaders do not set clock routes correctly.
>
As other folks mentioned, please align to the procedures for
sending the patches.
The change itself looks good, so looking forward for the proper
v2.
Regards,
Lukasz
On 18/08/2026 15:19, Jiawen Liu wrote: > Check clock-enable failures during probe. > > If a later clock cannot be enabled, unwind clocks already enabled on > that path before returning the error. > > Signed-off-by: jiawen <1298662399@qq.com> SoB does not match your "From" name. Please configure git correctly to use consistent identity. Best regards, Krzysztof
> Check clock-enable failures during probe. > > If a later clock cannot be enabled, unwind clocks already enabled on > that path before returning the error. How do you think about to add any tags (like “Fixes” and “Cc”) accordingly? See also once more: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v7.2#n34 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n145 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n792 Regards, Markus
© 2016 - 2026 Red Hat, Inc.