Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753500AbbL2OSa (ORCPT ); Tue, 29 Dec 2015 09:18:30 -0500 Received: from mout.web.de ([212.227.17.11]:62563 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753140AbbL2OS2 (ORCPT ); Tue, 29 Dec 2015 09:18:28 -0500 Subject: [PATCH 2/2] mfd: smsc-ece1099: Refactoring for smsc_i2c_probe() To: LKML , Lee Jones References: <566ABCD9.1060404@users.sourceforge.net> <5682957F.5000604@users.sourceforge.net> Cc: kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <56829630.6030706@users.sourceforge.net> Date: Tue, 29 Dec 2015 15:18:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5682957F.5000604@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Mv1pnewsdrzt4VV8R6FyBv7pRLuRyMM6fwgjf8Kssc5NwM4X1g1 PnR3vhcqvgiiP2Hc6cuhYIFfK1MN0/Nv8H1Vtrb8YLHqWa2T+IFQdcbb0XMgL4/kaf9gXe+ 1+0ZeklaowZ+HImORyyX1a4jagz/vyYfbyUImPaLAseKeSsyKBY+sRmqAgZ1QaZ4TdK00ni omciPvr5ONxniej/4bRCw== X-UI-Out-Filterresults: notjunk:1;V01:K0:qCzrXVLDroc=:fzatxn+vpz87yBAdq2ejSR Ooi8MQnnsfWJmu8b5DL5KRaQwh+DuOnaUJU6VUTnpx787BCEGCiBg0FR+ds8S2VwCtEkyUnrh /8Gvs1jE6gy88k/zk29lf6X6O06zryDfQJ22xVO1q6hkubW+dSID1rz/UnEOwLsmhaxq7HCi3 o+jEN1rtk+DQymI6FbOhfo2D1kWjDWZYEiQjnTUJ44WORG2/ARwnxjKQGU0E7RAJUrzYcaByn SMdyLYn18PupgaLF9STNFXZ3C8KzVh+VT0OuOZs5UEm0XSACJRPueTHy1WGVVviFbPkNxlqWM xjZ5sVX7VDp+Fhn1WFNcgRfJYzaly3aCzjRsK/0kV2OsHsuM91XGtxrQV85LFiffzS0GlIIvJ JeG02889AqZvg2p54oX7knhicZioDSgmRfLfwVGCdFo7Lv+r9uc1FSAfak4PYWOlq2iEiP3qf aiiU3mMTqlzmcnKtzjow8jfSWoNz1e9fGReapMw4ILV785fYie1BQRLe+2x/PeKXcOdXbLdn7 nv5e4O0P3joBlHx6AlF8YFGVsbOwQxnq4GHzA4/TJ8qy7Nyyb7tHG3zmwUHRMdZC4YlGUmi48 nYre47ki/IeGtLVyf+rexkhNK7eEuzJ2BQz2GA9DeRW8En0Gnr/jV3wzGa2/gG3+Sm322P5fr 4WktjSnFwCMQF6f6COYkAGdEBKT3AaY++ShVHHVPVY6/T6ikznBcZTSPzicbKTw68zvtlGN9X Uk6FxTmEHbZJ25ipkxkaz2dXR0+mbWxo8Gr2wQeebRgPuOhXhrJzcOopr2sOXXhGAuwtRTpfZ k3jSpYJoE0QWaTegGl+2TJfYd0fRg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1561 Lines: 57 From: Markus Elfring Date: Tue, 29 Dec 2015 15:03:31 +0100 This issue was detected by using the Coccinelle software. * Let us 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 bcac488..951333a 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; } -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/