From patchwork Wed Mar 14 19:56:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 10283465 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 5F1276061F for ; Wed, 14 Mar 2018 19:58:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F36D285C9 for ; Wed, 14 Mar 2018 19:58:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 440EF2861C; Wed, 14 Mar 2018 19:58:46 +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,FREEMAIL_FROM, 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 DF380285C9 for ; Wed, 14 Mar 2018 19:58:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750779AbeCNT6Z (ORCPT ); Wed, 14 Mar 2018 15:58:25 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:33289 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751461AbeCNT56 (ORCPT ); Wed, 14 Mar 2018 15:57:58 -0400 Received: from linux.numericable.fr ([77.198.79.136]) by mwinf5d56 with ME id Mvwi1x0082wTeBR03vxxyY; Wed, 14 Mar 2018 20:57:57 +0100 X-ME-Helo: linux.numericable.fr X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 14 Mar 2018 20:57:57 +0100 X-ME-IP: 77.198.79.136 From: Christophe JAILLET To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/3] remoteproc: imx_rproc: Re-use existing error handling path in 'imx_rproc_probe()' Date: Wed, 14 Mar 2018 20:56:38 +0100 Message-Id: <2b1b1c3ebd6798ac456affb0bb6580016f17afe8.1521057013.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: X-Antivirus: Avast (VPS 180314-2, 14/03/2018), Outbound message X-Antivirus-Status: Clean 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 Avoid some code ducplication and be more future-proof. Signed-off-by: Christophe JAILLET --- drivers/remoteproc/imx_rproc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 05bcbce2013a..6d02ef62a626 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -361,8 +361,8 @@ static int imx_rproc_probe(struct platform_device *pdev) priv->clk = devm_clk_get(dev, NULL); if (IS_ERR(priv->clk)) { dev_err(dev, "Failed to get clock\n"); - rproc_free(rproc); - return PTR_ERR(priv->clk); + ret = PTR_ERR(priv->clk); + goto err_put_rproc; } /* @@ -372,8 +372,7 @@ static int imx_rproc_probe(struct platform_device *pdev) ret = clk_prepare_enable(priv->clk); if (ret) { dev_err(&rproc->dev, "Failed to enable clock\n"); - rproc_free(rproc); - return ret; + goto err_put_rproc; } ret = rproc_add(rproc);