Commit 6a5ef3b2 authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Lucas Stach

drm/etnaviv: Simplify clock enable/disable

All the NULL checks are pointless, clk_*() routines already deal with NULL
just fine.
Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent a59052d2
...@@ -1487,55 +1487,40 @@ static int etnaviv_gpu_clk_enable(struct etnaviv_gpu *gpu) ...@@ -1487,55 +1487,40 @@ static int etnaviv_gpu_clk_enable(struct etnaviv_gpu *gpu)
{ {
int ret; int ret;
if (gpu->clk_reg) { ret = clk_prepare_enable(gpu->clk_reg);
ret = clk_prepare_enable(gpu->clk_reg); if (ret)
if (ret) return ret;
return ret;
}
if (gpu->clk_bus) { ret = clk_prepare_enable(gpu->clk_bus);
ret = clk_prepare_enable(gpu->clk_bus); if (ret)
if (ret) goto disable_clk_reg;
goto disable_clk_reg;
}
if (gpu->clk_core) { ret = clk_prepare_enable(gpu->clk_core);
ret = clk_prepare_enable(gpu->clk_core); if (ret)
if (ret) goto disable_clk_bus;
goto disable_clk_bus;
}
if (gpu->clk_shader) { ret = clk_prepare_enable(gpu->clk_shader);
ret = clk_prepare_enable(gpu->clk_shader); if (ret)
if (ret) goto disable_clk_core;
goto disable_clk_core;
}
return 0; return 0;
disable_clk_core: disable_clk_core:
if (gpu->clk_core) clk_disable_unprepare(gpu->clk_core);
clk_disable_unprepare(gpu->clk_core);
disable_clk_bus: disable_clk_bus:
if (gpu->clk_bus) clk_disable_unprepare(gpu->clk_bus);
clk_disable_unprepare(gpu->clk_bus);
disable_clk_reg: disable_clk_reg:
if (gpu->clk_reg) clk_disable_unprepare(gpu->clk_reg);
clk_disable_unprepare(gpu->clk_reg);
return ret; return ret;
} }
static int etnaviv_gpu_clk_disable(struct etnaviv_gpu *gpu) static int etnaviv_gpu_clk_disable(struct etnaviv_gpu *gpu)
{ {
if (gpu->clk_shader) clk_disable_unprepare(gpu->clk_shader);
clk_disable_unprepare(gpu->clk_shader); clk_disable_unprepare(gpu->clk_core);
if (gpu->clk_core) clk_disable_unprepare(gpu->clk_bus);
clk_disable_unprepare(gpu->clk_core); clk_disable_unprepare(gpu->clk_reg);
if (gpu->clk_bus)
clk_disable_unprepare(gpu->clk_bus);
if (gpu->clk_reg)
clk_disable_unprepare(gpu->clk_reg);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment