From patchwork Wed Mar 14 19:56:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 10283459 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 1C9BA6061F for ; Wed, 14 Mar 2018 19:58:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C38D285C9 for ; Wed, 14 Mar 2018 19:58:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00E5A2861C; Wed, 14 Mar 2018 19:58:20 +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 A1839285C9 for ; Wed, 14 Mar 2018 19:58:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbeCNT6H (ORCPT ); Wed, 14 Mar 2018 15:58:07 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:38888 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428AbeCNT57 (ORCPT ); Wed, 14 Mar 2018 15:57:59 -0400 Received: from linux.numericable.fr ([77.198.79.136]) by mwinf5d56 with ME id Mvwi1x0082wTeBR03vxyyg; Wed, 14 Mar 2018 20:57:58 +0100 X-ME-Helo: linux.numericable.fr X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 14 Mar 2018 20:57:58 +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 3/3] remoteproc: imx_rproc: Slightly simplify code in 'imx_rproc_probe()' Date: Wed, 14 Mar 2018 20:56:39 +0100 Message-Id: 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 We can return directly at the beginning of the function and save the 'err' label. We can also explicitly return 0 when the probe succeed. Signed-off-by: Christophe JAILLET --- drivers/remoteproc/imx_rproc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 6d02ef62a626..54c07fd3f204 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -333,10 +333,8 @@ static int imx_rproc_probe(struct platform_device *pdev) /* set some other name then imx */ rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops, NULL, sizeof(*priv)); - if (!rproc) { - ret = -ENOMEM; - goto err; - } + if (!rproc) + return -ENOMEM; dcfg = of_device_get_match_data(dev); if (!dcfg) { @@ -381,13 +379,13 @@ static int imx_rproc_probe(struct platform_device *pdev) goto err_put_clk; } - return ret; + return 0; err_put_clk: clk_disable_unprepare(priv->clk); err_put_rproc: rproc_free(rproc); -err: + return ret; }