public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Sonic Zhang <sonic.zhang@analog.com>,
	Michael Hennerich <michael.hennerich@analog.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] regulator: ad5398: Convert to devm_regulator_register
Date: Tue, 03 Sep 2013 14:20:25 +0800	[thread overview]
Message-ID: <1378189225.4621.5.camel@phoenix> (raw)
In-Reply-To: <1378189056.4621.1.camel@phoenix>

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/ad5398.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/regulator/ad5398.c b/drivers/regulator/ad5398.c
index 6b981b5..92f42fd 100644
--- a/drivers/regulator/ad5398.c
+++ b/drivers/regulator/ad5398.c
@@ -219,7 +219,6 @@ static int ad5398_probe(struct i2c_client *client,
 	struct ad5398_chip_info *chip;
 	const struct ad5398_current_data_format *df =
 			(struct ad5398_current_data_format *)id->driver_data;
-	int ret;
 
 	if (!init_data)
 		return -EINVAL;
@@ -240,33 +239,21 @@ static int ad5398_probe(struct i2c_client *client,
 	chip->current_offset = df->current_offset;
 	chip->current_mask = (chip->current_level - 1) << chip->current_offset;
 
-	chip->rdev = regulator_register(&ad5398_reg, &config);
+	chip->rdev = devm_regulator_register(&client->dev, &ad5398_reg,
+					     &config);
 	if (IS_ERR(chip->rdev)) {
-		ret = PTR_ERR(chip->rdev);
 		dev_err(&client->dev, "failed to register %s %s\n",
 			id->name, ad5398_reg.name);
-		goto err;
+		return PTR_ERR(chip->rdev);
 	}
 
 	i2c_set_clientdata(client, chip);
 	dev_dbg(&client->dev, "%s regulator driver is registered.\n", id->name);
 	return 0;
-
-err:
-	return ret;
-}
-
-static int ad5398_remove(struct i2c_client *client)
-{
-	struct ad5398_chip_info *chip = i2c_get_clientdata(client);
-
-	regulator_unregister(chip->rdev);
-	return 0;
 }
 
 static struct i2c_driver ad5398_driver = {
 	.probe = ad5398_probe,
-	.remove = ad5398_remove,
 	.driver		= {
 		.name	= "ad5398",
 	},
-- 
1.8.1.2




  parent reply	other threads:[~2013-09-03  6:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03  6:17 [PATCH 1/8] regulator: 88pm8607: Convert to devm_regulator_register Axel Lin
2013-09-03  6:19 ` [PATCH 2/8] regulator: aat2870: " Axel Lin
2013-09-03 10:16   ` jinyoungp
2013-09-03  6:20 ` Axel Lin [this message]
2013-09-03  6:22 ` [PATCH 4/8] regulator: as3711: " Axel Lin
2013-09-03  6:23 ` [PATCH 5/8] regulator: da903x: " Axel Lin
2013-09-03  6:24 ` [PATCH 6/8] regulator: da9052: " Axel Lin
2013-09-03  6:26 ` [PATCH 7/8] regulator: da9055: " Axel Lin
2013-09-03  6:27 ` [PATCH 8/8] regulator: fan53555: " Axel Lin
2013-09-03  9:26 ` [PATCH 1/8] regulator: 88pm8607: " Mark Brown

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=1378189225.4621.5.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=sonic.zhang@analog.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