From patchwork Mon Jan 15 13:17:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10164197 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 55149602C2 for ; Mon, 15 Jan 2018 13:17:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52AC8286A1 for ; Mon, 15 Jan 2018 13:17:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 477D028798; Mon, 15 Jan 2018 13:17:47 +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 DCEC4286A1 for ; Mon, 15 Jan 2018 13:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030258AbeAONRc (ORCPT ); Mon, 15 Jan 2018 08:17:32 -0500 Received: from mout.web.de ([212.227.15.14]:52101 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967362AbeAONR3 (ORCPT ); Mon, 15 Jan 2018 08:17:29 -0500 Received: from [192.168.1.3] ([92.224.130.50]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MSIwN-1eQvTJ40V9-00TSnv; Mon, 15 Jan 2018 14:17:27 +0100 Subject: [PATCH 3/3] mfd/omap-usb-tll: Return an error code only as a constant in usbtll_omap_probe() From: SF Markus Elfring To: linux-omap@vger.kernel.org, Lee Jones , Tony Lindgren Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <367e77d8-3a65-2c12-5e79-75a626b65f41@users.sourceforge.net> Date: Mon, 15 Jan 2018 14:17:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:8igsCdKqTWNF9tHixPWIG6PH/4plYpPDz9mmeMWy4ykzHHyGKXm ZjEBQhyCx3NrDlSdF6vJ+DtFtdEu9m55hNaJXqJ+jAaTRp2C2Zbxarg4NuPif4XTriQzcaG BdmC49FWux6d1JBtLUMdiwRERL87EM8l3452RK0fn9ygwSIdJ+pHLDE60EbcEiNmQ3GvQBZ AeGOSFtHj5Qbne1qa3atw== X-UI-Out-Filterresults: notjunk:1; V01:K0:iX2gPa3Ai/U=:YO8a5AM315y16luqol0OqB LX/XLxdKhyLixpFnJaG2DOBkmI5eOe2JtbS/yfaK80QijKX5460Q9Igk+Isfk8zUQkaD1Zk61 3dYsvG/LRwfSFWO0vF2aPJMZZ9/UhWai4yLc1P6yZtn6fCWzfIt7PQTbQpLr4qxRcNKeRIP8U g/dbp3vwI0DyMYPBMG8s3YzXVlYsUWzltQWskqASi3GisUxw/E3wv3TKz0Iq+nW1piF33Kz7w aa9YLT41Cytyp5psn86SMlpv+PvDjMj7V68+ZemfyHI7+jpbdQ0Q8xt0fjQlfd4UgumXr0BLm Z3KikABvQgKhFWhQqreUuhnpIhrHYZSXN8BLQlDY5j9q4fhLTDQp1Jg5AHCeYX1b483O0qOiD brDejw5AApbNX93sVH2+STLsMuOY7wF4QsQn6z3poEe6kohRhbYXTdQk4zA/l+iBicGvaNr6Z MnI2egDfBPj1PCS6Cu7QFpzTzWBIApBFZhgRfATfALb+dX/rSZ/b7We/bp3vW1IcLKepcnGQz XFVVnAxJZl0JzjQ8zqNaZdOTyIlQ+jnXYX0tqV+PPSY/3fO39i1JmIgvY0RHZrOJTUtZC7jW9 A6zJm/CaYQJm/7JAj2ZR4MJ3dwmvvLNtkFpDJ5w1g2k0QF33OXYQagOwk6Bgn7tWrRCxwKb6S KZFT9cKYbh+3anfRsCCnJs6yx3gkxUyf9dNOBWntL3qcaR2qSnUA7+mvbBNzQ0y7VVS4whsYo s98sr/Muc3YaJKoxJ/IPlB9TvfH/9zy6F2r2GF/Pc0AXS7D0gX7v60iPwo+GMJw4HWjRSKhdK 54PRgIa5Zfii6wjWQcOTd8jARQh6TurrHzx0Iffm4GfWNHgouo= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 15 Jan 2018 14:00:45 +0100 * Return an error code without storing it in an intermediate variable. * Delete the label "err_clk_alloc" and local variable "ret" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/mfd/omap-usb-tll.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c index c8b4ad40910a..6c0be886fd87 100644 --- a/drivers/mfd/omap-usb-tll.c +++ b/drivers/mfd/omap-usb-tll.c @@ -216,7 +216,6 @@ static int usbtll_omap_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res; struct usbtll_omap *tll; - int ret = 0; int i, ver; dev_dbg(dev, "starting TI HSUSB TLL Controller\n"); @@ -254,8 +253,9 @@ static int usbtll_omap_probe(struct platform_device *pdev) tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk *) * tll->nch, GFP_KERNEL); if (!tll->ch_clk) { - ret = -ENOMEM; - goto err_clk_alloc; + pm_runtime_put_sync(dev); + pm_runtime_disable(dev); + return -ENOMEM; } for (i = 0; i < tll->nch; i++) { @@ -278,12 +278,6 @@ static int usbtll_omap_probe(struct platform_device *pdev) spin_unlock(&tll_lock); return 0; - -err_clk_alloc: - pm_runtime_put_sync(dev); - pm_runtime_disable(dev); - - return ret; } /**