diff mbox series

[v3,1/4] remoteproc: st: correct probe error management

Message ID 1485866156-6364-2-git-send-email-loic.pallardy@st.com
State Accepted
Commit 3e49ecf6b49c31b70235d260b957376c00265c1e
Headers show
Series remoteproc: st: add virtio_rpmsg support | expand

Commit Message

Loic Pallardy Jan. 31, 2017, 12:35 p.m. UTC
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>

---
Changes from V2:
New patch fixing st_rproc_probe error management

 drivers/remoteproc/st_remoteproc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
1.9.1

Comments

Bjorn Andersson Feb. 6, 2017, 9:19 p.m. UTC | #1
On Tue 31 Jan 04:35 PST 2017, Loic Pallardy wrote:

> 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>


Applied patch 1 and 2.

Regards,
Bjorn
Loic Pallardy Feb. 7, 2017, 10:20 p.m. UTC | #2
> -----Original Message-----

> From: Bjorn Andersson [mailto:bjorn.andersson@linaro.org]

> Sent: Monday, February 06, 2017 10:20 PM

> To: Loic PALLARDY <loic.pallardy@st.com>

> Cc: ohad@wizery.com; lee.jones@linaro.org; linux-

> remoteproc@vger.kernel.org; linux-kernel@vger.kernel.org;

> kernel@stlinux.com; Patrice CHOTARD <patrice.chotard@st.com>; Hugues

> FRUCHET <hugues.fruchet@st.com>; peter.griffin@linaro.org

> Subject: Re: [PATCH v3 1/4] remoteproc: st: correct probe error management

> 

> On Tue 31 Jan 04:35 PST 2017, Loic Pallardy wrote:

> 

> > 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>

> 

> Applied patch 1 and 2.

Thanks Bjorn.
Did you have time to review patch 3 and 4?
Regards,
Loic
> 

> Regards,

> Bjorn
diff mbox series

Patch

diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
index da4e152..bdfab49 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)
 	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;