summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorLoic Pallardy <loic.pallardy@st.com>2017-01-31 07:35:53 -0500
committerBjorn Andersson <bjorn.andersson@linaro.org>2017-02-06 16:09:01 -0500
commit3e49ecf6b49c31b70235d260b957376c00265c1e (patch)
tree8ccc37ec3f52d3bdfd367b6427111c1006f21f2d /drivers/remoteproc
parent5e6533f72ce849bf49aaee96429bbe3558789d08 (diff)
remoteproc: st: correct probe error management
Associated clock is prepared in st_rproc_parse_dt function. it should be unprepared in case of error during probing. Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/st_remoteproc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
index f21787b602e3..1468ba213811 100644
--- a/drivers/remoteproc/st_remoteproc.c
+++ b/drivers/remoteproc/st_remoteproc.c
@@ -247,7 +247,7 @@ static int st_rproc_probe(struct platform_device *pdev)
247 enabled = st_rproc_state(pdev); 247 enabled = st_rproc_state(pdev);
248 if (enabled < 0) { 248 if (enabled < 0) {
249 ret = enabled; 249 ret = enabled;
250 goto free_rproc; 250 goto free_clk;
251 } 251 }
252 252
253 if (enabled) { 253 if (enabled) {
@@ -259,10 +259,12 @@ static int st_rproc_probe(struct platform_device *pdev)
259 259
260 ret = rproc_add(rproc); 260 ret = rproc_add(rproc);
261 if (ret) 261 if (ret)
262 goto free_rproc; 262 goto free_clk;
263 263
264 return 0; 264 return 0;
265 265
266free_clk:
267 clk_unprepare(ddata->clk);
266free_rproc: 268free_rproc:
267 rproc_free(rproc); 269 rproc_free(rproc);
268 return ret; 270 return ret;