drm/etnaviv: Fix error path on failure to enable bus clk
authorLubomir Rintel <lkundrak@v3.sk>
Tue, 16 Jun 2020 21:21:24 +0000 (23:21 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Thu, 18 Jun 2020 12:23:10 +0000 (14:23 +0200)
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 <lkundrak@v3.sk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c

index a31eeff2b297a5cb56bb4161a7c572c8948f7c2c..c6dacfe3d321ebe92cfa3290fd1a71203e114e86 100644 (file)
@@ -1496,7 +1496,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) {
@@ -1519,6 +1519,9 @@ disable_clk_core:
 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;
 }