From patchwork Sun Jun 26 13:54:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9199531 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 AC23A607D3 for ; Sun, 26 Jun 2016 13:59:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8961F28540 for ; Sun, 26 Jun 2016 13:59:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A4AB2854B; Sun, 26 Jun 2016 13:59:40 +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 1A5D528540 for ; Sun, 26 Jun 2016 13:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752220AbcFZN7i (ORCPT ); Sun, 26 Jun 2016 09:59:38 -0400 Received: from mout.web.de ([212.227.17.12]:49521 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbcFZN7h (ORCPT ); Sun, 26 Jun 2016 09:59:37 -0400 Received: from [192.168.1.2] ([77.182.59.103]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0M73WL-1bbZ7L1b1B-00wiav; Sun, 26 Jun 2016 15:54:22 +0200 Subject: [PATCH 6/6] mfd: smsc-ece1099: Return directly after a function failure in smsc_i2c_probe() To: Lee Jones , Tony Lindgren , linux-omap@vger.kernel.org References: <566ABCD9.1060404@users.sourceforge.net> <5682D228.7070902@users.sourceforge.net> <20160111082922.GB14104@x1> <05b7db2a-437a-60ac-d289-71d2150e7f5f@users.sourceforge.net> <20160608111442.GB14888@dell> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <7de4f21e-30a2-fab6-204d-890619ccbbe6@users.sourceforge.net> Date: Sun, 26 Jun 2016 15:54:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:APZecT7yJ0hMaN8so6Unsii33KU1jNDgsIBJRlaBD3Vx0uvcMNN 6MGYMYX5/cSZa0PN2myC0NKyrG11ji/1SbSx3YiZd3PGVoqqmLk0Ii5h4re5NZWIgyQUTsC Fd25yqN5HMAokxwrbhB6fcj8AJX64+U+6rhW4trz6PlXXaUHW/y3hjZkZ15CTC21N1RHdC7 oaeWmZZ6vgt1PyoJ1FKtw== X-UI-Out-Filterresults: notjunk:1; V01:K0:4zwcAy5cEtw=:u0EPLnP9n6SNns5s6R5mnF 91YLYsnGoiDmJDgJY7ntculIyxKIGGX+fO8VTMSlJWzU6O9+hgoLs37oc6G6+4w+NizADr9xU zZeG1E5RKby4YCpOlYeNS6lbQlK/moQZQqnkZ/Kf9dcBdR9V3w65bo/GUdT+ojcWjSUHI4Ofx ue2ixFVGfNC+/DtJFGVxYi2Oapey+TManVyjKtmhaa9ls0VCFD94RN9DVY7yDpegf1uqL34XV D/7GNtcJMOqeknSrM4xFe2UEEKX47XxIkhGiHJEuTaZz8OOQLM62F43HrLuOqC0N8J43MZWPp ngR7GLdkng42zv2a5KU3b3rD8VlSHOjglqopdI8ouWY2qJAN/brtR798DvP/x1/foZvxGuScA 4CG0G4zdFLnzZ3aLPjdJEKWtGSu27c+Y5idreHczAD21tY/MmE3oX5JqXxsi9IH3HHyVQlmzj KRxKjzI4KbrJzaJ8EH0VvDdfOXkWVJuR9rqTJTg26xQKrCYCZRBqIxd24ijc7+5EiMHOXgUGO yRzzEBsnuajsNMQIIXzhhCAtjuEckYXlViax9aqv41rmpkmEyoKFkNDdZaMNlwxXZ7+WqUUql 5Zie6kNKuczDVmj/aevIuejKoWzPQmKX+DVF61/d/SEhyumW25MvP/6yM7wMO+BFkkE/J9kDm Hhsa/U+87ECrFHDFZ3L6viP+gLESEFWA8IHnb+xrJQ8gaUdFRhgPbR/r5r5DbJ8xMRGkuUVzx H/GJkeDAa1Wlr+5s4sFUuYhe7DfWwFVPgVlvGWAjOTS0mTau8g4auVu8jAwoUtar51q5mJIMf CHje1K+ 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: Sun, 26 Jun 2016 14:30:46 +0200 This issue was detected by using the Coccinelle software. Return directly if a call of the function "devm_regmap_init_i2c" or "regmap_write" failed. Delete the jump label "err" then. Signed-off-by: Markus Elfring --- drivers/mfd/smsc-ece1099.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c index 2aaf89f..cd18c09 100644 --- a/drivers/mfd/smsc-ece1099.c +++ b/drivers/mfd/smsc-ece1099.c @@ -46,10 +46,8 @@ static int smsc_i2c_probe(struct i2c_client *i2c, } smsc->regmap = devm_regmap_init_i2c(i2c, &smsc_regmap_config); - if (IS_ERR(smsc->regmap)) { - ret = PTR_ERR(smsc->regmap); - goto err; - } + if (IS_ERR(smsc->regmap)) + return PTR_ERR(smsc->regmap); i2c_set_clientdata(i2c, smsc); smsc->dev = &i2c->dev; @@ -68,7 +66,7 @@ static int smsc_i2c_probe(struct i2c_client *i2c, ret = regmap_write(smsc->regmap, SMSC_CLK_CTRL, smsc->clk); if (ret) - goto err; + return ret; #ifdef CONFIG_OF if (i2c->dev.of_node) @@ -76,7 +74,6 @@ static int smsc_i2c_probe(struct i2c_client *i2c, NULL, NULL, &i2c->dev); #endif -err: return ret; }