[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200430124602.14463-3-frieder.schrempf@kontron.de>
Date: Thu, 30 Apr 2020 12:46:10 +0000
From: Schrempf Frieder <frieder.schrempf@...tron.de>
To: Adam Ford <aford173@...il.com>, Anson Huang <Anson.Huang@....com>,
Christian Gmeiner <christian.gmeiner@...il.com>,
Daniel Baluta <daniel.baluta@....com>,
Fabio Estevam <festevam@...il.com>,
Schrempf Frieder <frieder.schrempf@...tron.de>,
Leonard Crestez <leonard.crestez@....com>,
"Li Jun" <jun.li@....com>, Lucas Stach <l.stach@...gutronix.de>,
NXP Linux Team <linux-imx@....com>,
Peng Fan <peng.fan@....com>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Russell King <linux+etnaviv@...linux.org.uk>,
"Sascha Hauer" <s.hauer@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>,
"S.j. Wang" <shengjiu.wang@....com>
CC: "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"etnaviv@...ts.freedesktop.org" <etnaviv@...ts.freedesktop.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [RFC PATCH 2/4] drm/etnaviv: Fix error path in
etnaviv_gpu_clk_enable()
From: Frieder Schrempf <frieder.schrempf@...tron.de>
In case enabling of the bus clock fails etnaviv_gpu_clk_enable()
returns without disabling the already enabled reg clock. Fix this.
Fixes: 65f037e8e908 ("drm/etnaviv: add support for slave interface clock")
Signed-off-by: Frieder Schrempf <frieder.schrempf@...tron.de>
---
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 23877c1f150a..7b138d4dd068 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -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 @@ 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.17.1
Powered by blists - more mailing lists