From: Lubomir Rintel <lkund...@v3.sk>

[ Upstream commit f8794feaf65cdc97767604cf864775d20b97f397 ]

Since commit 65f037e8e908 ("drm/etnaviv: add support for slave interface
clock") the reg clock is enabled before the bus clock and we need to undo
its enablement on error.

Fixes: 65f037e8e908 ("drm/etnaviv: add support for slave interface clock")
Signed-off-by: Lubomir Rintel <lkund...@v3.sk>
Signed-off-by: Lucas Stach <l.st...@pengutronix.de>
Signed-off-by: Sasha Levin <sas...@kernel.org>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 8a26ea2a53348..85de8551ce866 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1463,7 +1463,7 @@ static int etnaviv_gpu_clk_enable(struct etnaviv_gpu *gpu)
        if (gpu->clk_bus) {
                ret = clk_prepare_enable(gpu->clk_bus);
                if (ret)
-                       return ret;
+                       goto disable_clk_reg;
        }
 
        if (gpu->clk_core) {
@@ -1486,6 +1486,9 @@ static int etnaviv_gpu_clk_enable(struct etnaviv_gpu *gpu)
 disable_clk_bus:
        if (gpu->clk_bus)
                clk_disable_unprepare(gpu->clk_bus);
+disable_clk_reg:
+       if (gpu->clk_reg)
+               clk_disable_unprepare(gpu->clk_reg);
 
        return ret;
 }
-- 
2.25.1



Reply via email to