Skip to contentSkip to conversation

regulator: lm363x: Remove struct lm363x_regulator which is not necessary

PATCH In review Axel Lin 2 participants 2 messages Nov 29, 2015 – Nov 30, 2015 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: lm363x: Remove struct lm363x_regulator which is not necessary

---
 drivers/regulator/lm363x-regulator.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
drivers/regulator/lm363x-regulator.c +1 -19
index e1b683e..3858735 100644
@@ -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;
 }
 
Signature · 1 line
2.1.4
maintainer
#1 lore raw

Applied "regulator: lm363x: Remove struct lm363x_regulator which is not necessary" to the regulator tree

The patch

regulator: lm363x: Remove struct lm363x_regulator which is not necessary

has been applied to the regulator tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From a8bc6ca0707c71fe7085543dc6d76b077e0ae89e Mon Sep 17 00:00:00 2001

From: Axel Lin <[email protected]>
Date: Sun, 29 Nov 2015 14:58:54 +0800
Subject: [PATCH] regulator: lm363x: Remove struct lm363x_regulator which is
not necessary

---
 drivers/regulator/lm363x-regulator.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
drivers/regulator/lm363x-regulator.c +1 -19
index e1b683e02561..38587359cd2d 100644
@@ -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;
 }
 
Signature · 1 line
2.6.2