From patchwork Tue Jan 31 12:35:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic PALLARDY X-Patchwork-Id: 9547103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE5A06016C for ; Tue, 31 Jan 2017 12:36:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E04C126E90 for ; Tue, 31 Jan 2017 12:36:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3D2228334; Tue, 31 Jan 2017 12:36:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65BE826E90 for ; Tue, 31 Jan 2017 12:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752049AbdAaMg3 (ORCPT ); Tue, 31 Jan 2017 07:36:29 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:26399 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959AbdAaMgW (ORCPT ); Tue, 31 Jan 2017 07:36:22 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id v0VCWORC004005; Tue, 31 Jan 2017 13:36:18 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-.pphosted.com with ESMTP id 288hn1pmcr-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 31 Jan 2017 13:36:18 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DC09138; Tue, 31 Jan 2017 12:36:17 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas4.st.com [10.75.90.69]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BC5662AC8; Tue, 31 Jan 2017 12:36:17 +0000 (GMT) Received: from localhost (10.201.23.23) by webmail-eu.st.com (10.75.90.13) with Microsoft SMTP Server (TLS) id 8.3.444.0; Tue, 31 Jan 2017 13:36:17 +0100 From: Loic Pallardy To: , , CC: , , , , , , Subject: [PATCH v3 1/4] remoteproc: st: correct probe error management Date: Tue, 31 Jan 2017 13:35:53 +0100 Message-ID: <1485866156-6364-2-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485866156-6364-1-git-send-email-loic.pallardy@st.com> References: <1485866156-6364-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-31_05:, , signatures=0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Changes from V2: New patch fixing st_rproc_probe error management drivers/remoteproc/st_remoteproc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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;