]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:16:07 +0000 (08:16 +0200)
[ 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 <lkundrak@v3.sk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c

index 8a26ea2a53348f31264badfea016ea69f2c3c5d7..85de8551ce8662cf4b57c8a396c389a63e262e8b 100644 (file)
@@ -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 @@ 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;
 }