mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Samuel Ortiz <sameo@linux.intel.com>, Lee Jones <lee.jones@linaro.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] MFD: twl6040: Cleanup in early error handling in probe function
Date: Fri, 12 Jul 2013 13:32:04 +0200	[thread overview]
Message-ID: <1373628724-11397-3-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1373628724-11397-1-git-send-email-peter.ujfalusi@ti.com>

The err: label is not needed we can just return instead of the jump there.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/mfd/twl6040.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
index 3bd110e..4d8d3b7 100644
--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -533,16 +533,12 @@ static int twl6040_probe(struct i2c_client *client,
 
 	twl6040 = devm_kzalloc(&client->dev, sizeof(struct twl6040),
 			       GFP_KERNEL);
-	if (!twl6040) {
-		ret = -ENOMEM;
-		goto err;
-	}
+	if (!twl6040)
+		return -ENOMEM;
 
 	twl6040->regmap = devm_regmap_init_i2c(client, &twl6040_regmap_config);
-	if (IS_ERR(twl6040->regmap)) {
-		ret = PTR_ERR(twl6040->regmap);
-		goto err;
-	}
+	if (IS_ERR(twl6040->regmap))
+		return PTR_ERR(twl6040->regmap);
 
 	i2c_set_clientdata(client, twl6040);
 
@@ -660,7 +656,7 @@ gpio_err:
 	regulator_bulk_disable(TWL6040_NUM_SUPPLIES, twl6040->supplies);
 regulator_get_err:
 	i2c_set_clientdata(client, NULL);
-err:
+
 	return ret;
 }
 
-- 
1.8.2.1


  parent reply	other threads:[~2013-07-12 11:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12 11:32 [PATCH 1/3] MFD: twl6040: Remove support for legacy (pdata) mode Peter Ujfalusi
2013-07-12 11:32 ` [PATCH 2/3] MFD: twl6040: Cosmetic, parameter alignment change Peter Ujfalusi
2013-07-12 13:50   ` Lee Jones
2013-07-12 11:32 ` Peter Ujfalusi [this message]
2013-07-12 13:51   ` [PATCH 3/3] MFD: twl6040: Cleanup in early error handling in probe function Lee Jones
2013-07-12 13:49 ` [PATCH 1/3] MFD: twl6040: Remove support for legacy (pdata) mode Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373628724-11397-3-git-send-email-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®