remoteproc: st: correct probe error management
authorLoic Pallardy <loic.pallardy@st.com>
Tue, 31 Jan 2017 12:35:53 +0000 (13:35 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 6 Feb 2017 21:09:01 +0000 (13:09 -0800)
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>
drivers/remoteproc/st_remoteproc.c

index f21787b602e3ac9493f42d022cda55586f6ed6b7..1468ba213811abcce6c6296bd13e85aee4f27a92 100644 (file)
@@ -247,7 +247,7 @@ static int st_rproc_probe(struct platform_device *pdev)
        enabled = st_rproc_state(pdev);
        if (enabled < 0) {
                ret = enabled;
-               goto free_rproc;
+               goto free_clk;
        }
 
        if (enabled) {
@@ -259,10 +259,12 @@ static int st_rproc_probe(struct platform_device *pdev)
 
        ret = rproc_add(rproc);
        if (ret)
-               goto free_rproc;
+               goto free_clk;
 
        return 0;
 
+free_clk:
+       clk_unprepare(ddata->clk);
 free_rproc:
        rproc_free(rproc);
        return ret;