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: Milo Kim <milo.kim@ti.com>, Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: lm363x: Remove struct lm363x_regulator which is not necessary
Date: Sun, 29 Nov 2015 14:58:54 +0800	[thread overview]
Message-ID: <1448780334.27696.1.camel@ingics.com> (raw)

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

diff --git a/drivers/regulator/lm363x-regulator.c b/drivers/regulator/lm363x-regulator.c
index e1b683e..3858735 100644
--- a/drivers/regulator/lm363x-regulator.c
+++ b/drivers/regulator/lm363x-regulator.c
@@ -41,18 +41,12 @@
 #define LM363X_STEP_50mV		50000
 #define LM363X_STEP_500mV		500000
 
-struct lm363x_regulator {
-	struct regmap *regmap;
-	struct regulator_dev *regulator;
-};
-
 const int ldo_cont_enable_time[] = {
 	0, 2000, 5000, 10000, 20000, 50000, 100000, 200000,
 };
 
 static int lm363x_regulator_enable_time(struct regulator_dev *rdev)
 {
-	struct lm363x_regulator *lm363x_regulator = rdev_get_drvdata(rdev);
 	enum lm363x_regulator_id id = rdev_get_id(rdev);
 	u8 val, addr, mask;
 
@@ -77,7 +71,7 @@ static int lm363x_regulator_enable_time(struct regulator_dev *rdev)
 		return 0;
 	}
 
-	if (regmap_read(lm363x_regulator->regmap, addr, (unsigned int *)&val))
+	if (regmap_read(rdev->regmap, addr, (unsigned int *)&val))
 		return -EINVAL;
 
 	val = (val & mask) >> LM3631_ENTIME_SHIFT;
@@ -244,7 +238,6 @@ static int lm363x_regulator_of_get_enable_gpio(struct device_node *np, int id)
 static int lm363x_regulator_probe(struct platform_device *pdev)
 {
 	struct ti_lmu *lmu = dev_get_drvdata(pdev->dev.parent);
-	struct lm363x_regulator *lm363x_regulator;
 	struct regmap *regmap = lmu->regmap;
 	struct regulator_config cfg = { };
 	struct regulator_dev *rdev;
@@ -252,15 +245,7 @@ static int lm363x_regulator_probe(struct platform_device *pdev)
 	int id = pdev->id;
 	int ret, ena_gpio;
 
-	lm363x_regulator = devm_kzalloc(dev, sizeof(*lm363x_regulator),
-					GFP_KERNEL);
-	if (!lm363x_regulator)
-		return -ENOMEM;
-
-	lm363x_regulator->regmap = regmap;
-
 	cfg.dev = dev;
-	cfg.driver_data = lm363x_regulator;
 	cfg.regmap = regmap;
 
 	/*
@@ -288,9 +273,6 @@ static int lm363x_regulator_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	lm363x_regulator->regulator = rdev;
-	platform_set_drvdata(pdev, lm363x_regulator);
-
 	return 0;
 }
 
-- 
2.1.4




             reply	other threads:[~2015-11-29  6:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-29  6:58 Axel Lin [this message]
2015-11-30 12:25 ` Applied "regulator: lm363x: Remove struct lm363x_regulator which is not necessary" to the regulator tree 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=1448780334.27696.1.camel@ingics.com \
    --to=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milo.kim@ti.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