From patchwork Fri Feb 14 09:51:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 24615 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 328B8202E2 for ; Fri, 14 Feb 2014 09:56:43 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id gq1sf44520562obb.8 for ; Fri, 14 Feb 2014 01:56:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=VNuKuLSujCl4dta9LINDHD9eh6pBOXFp2EgScMaz0Ws=; b=EXh+CjtC7/ZLQ5hBbYFjD1zbOur0w4TpvP6eqKZ9P2q1q9R9JWCP1BazMfeBEXBBxv rHsdSkxFwV7gpdwRzZKdGGbAIF0TGtngTcNZiI0jhNjo4CpaB3rqc17OSrg9ILdI4RQ4 sVFFbsfNHpK2B4Jl1fomL6LLkrBgYcpD0Bt+6pUwevjPlI+1hr7yd59HFHEK8izgduBl 72eAsOdNVAKqZkwFDYqs97SExdIsUbYRuANIgMQViWo9DVmm1AovKi1Rvdz7/x5MP2JS XYbjnNbhzwTu9c9NLFt4lRIXi9KyglPRdf0YoFMzstlIC/AM4XXUbR9rg4VJEoJ+cUDb Am+Q== X-Gm-Message-State: ALoCoQnfUIWPCO5OiKfglq1u4DiFJeNcPmsT0rHxqoKRmLI35FlnEQiXnJ04cgfnxFn6Z7/dnCf6 X-Received: by 10.43.69.210 with SMTP id yd18mr2447964icb.10.1392371802243; Fri, 14 Feb 2014 01:56:42 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.165 with SMTP id l34ls27012qgd.5.gmail; Fri, 14 Feb 2014 01:56:42 -0800 (PST) X-Received: by 10.52.184.73 with SMTP id es9mr431639vdc.31.1392371802125; Fri, 14 Feb 2014 01:56:42 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id gq1si1763469vec.23.2014.02.14.01.56.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Feb 2014 01:56:42 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id jx11so2354560veb.35 for ; Fri, 14 Feb 2014 01:56:42 -0800 (PST) X-Received: by 10.52.107.35 with SMTP id gz3mr3978637vdb.8.1392371801821; Fri, 14 Feb 2014 01:56:41 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp95956vcz; Fri, 14 Feb 2014 01:56:41 -0800 (PST) X-Received: by 10.68.218.65 with SMTP id pe1mr7895728pbc.1.1392371800834; Fri, 14 Feb 2014 01:56:40 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si5190901paa.170.2014.02.14.01.56.40; Fri, 14 Feb 2014 01:56:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751918AbaBNJ4a (ORCPT + 27 others); Fri, 14 Feb 2014 04:56:30 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:65077 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbaBNJ42 (ORCPT ); Fri, 14 Feb 2014 04:56:28 -0500 Received: by mail-pb0-f47.google.com with SMTP id rp16so12118773pbb.34 for ; Fri, 14 Feb 2014 01:56:27 -0800 (PST) X-Received: by 10.67.1.202 with SMTP id bi10mr8100342pad.68.1392371787662; Fri, 14 Feb 2014 01:56:27 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id bc4sm15414958pbb.2.2014.02.14.01.56.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Feb 2014 01:56:26 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, sachin.kamat@linaro.org Subject: [PATCH v2] mfd: wm8400-core: Remove unnecessary goto Date: Fri, 14 Feb 2014 15:21:05 +0530 Message-Id: <1392371465-25294-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Return directly to avoid redundant lines of code. Signed-off-by: Sachin Kamat Acked-by: Lee Jones --- Changes since v1: Changed (wm8400 == NULL) -> (!wm8400) --- drivers/mfd/wm8400-core.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c index d66d256551fb..e5eae751aa1b 100644 --- a/drivers/mfd/wm8400-core.c +++ b/drivers/mfd/wm8400-core.c @@ -161,31 +161,19 @@ static int wm8400_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct wm8400 *wm8400; - int ret; wm8400 = devm_kzalloc(&i2c->dev, sizeof(struct wm8400), GFP_KERNEL); - if (wm8400 == NULL) { - ret = -ENOMEM; - goto err; - } + if (!wm8400) + return -ENOMEM; wm8400->regmap = devm_regmap_init_i2c(i2c, &wm8400_regmap_config); - if (IS_ERR(wm8400->regmap)) { - ret = PTR_ERR(wm8400->regmap); - goto err; - } + if (IS_ERR(wm8400->regmap)) + return PTR_ERR(wm8400->regmap); wm8400->dev = &i2c->dev; i2c_set_clientdata(i2c, wm8400); - ret = wm8400_init(wm8400, dev_get_platdata(&i2c->dev)); - if (ret != 0) - goto err; - - return 0; - -err: - return ret; + return wm8400_init(wm8400, dev_get_platdata(&i2c->dev)); } static int wm8400_i2c_remove(struct i2c_client *i2c)