The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/8] regulator: max1586: Remove regulator_dev pointer from state container
@ 2014-03-10  8:32 Krzysztof Kozlowski
  2014-03-10  8:32 ` [PATCH 2/8] regulator: max77686: Remove regulator_dev array " Krzysztof Kozlowski
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2014-03-10  8:32 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, linux-kernel; +Cc: Krzysztof Kozlowski

Don't store pointer to regulator_dev returned by
devm_regulator_register() in state container. It isn't used anywhere
outside of max1586_pmic_probe() function.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/regulator/max1586.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c
index e242dd316d36..c2a40a1a9e3e 100644
--- a/drivers/regulator/max1586.c
+++ b/drivers/regulator/max1586.c
@@ -46,8 +46,6 @@ struct max1586_data {
 
 	unsigned int v3_curr_sel;
 	unsigned int v6_curr_sel;
-
-	struct regulator_dev *rdev[0];
 };
 
 /*
@@ -162,7 +160,6 @@ static struct regulator_desc max1586_reg[] = {
 static int max1586_pmic_probe(struct i2c_client *client,
 					const struct i2c_device_id *i2c_id)
 {
-	struct regulator_dev **rdev;
 	struct max1586_platform_data *pdata = dev_get_platdata(&client->dev);
 	struct regulator_config config = { };
 	struct max1586_data *max1586;
@@ -186,8 +183,9 @@ static int max1586_pmic_probe(struct i2c_client *client,
 	max1586->v3_curr_sel = 24; /* 1.3V */
 	max1586->v6_curr_sel = 0;
 
-	rdev = max1586->rdev;
 	for (i = 0; i < pdata->num_subdevs && i <= MAX1586_V6; i++) {
+		struct regulator_dev *rdev;
+
 		id = pdata->subdevs[i].id;
 		if (!pdata->subdevs[i].platform_data)
 			continue;
@@ -207,12 +205,12 @@ static int max1586_pmic_probe(struct i2c_client *client,
 		config.init_data = pdata->subdevs[i].platform_data;
 		config.driver_data = max1586;
 
-		rdev[i] = devm_regulator_register(&client->dev,
+		rdev = devm_regulator_register(&client->dev,
 						  &max1586_reg[id], &config);
-		if (IS_ERR(rdev[i])) {
+		if (IS_ERR(rdev)) {
 			dev_err(&client->dev, "failed to register %s\n",
 				max1586_reg[id].name);
-			return PTR_ERR(rdev[i]);
+			return PTR_ERR(rdev);
 		}
 	}
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-03-10  9:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10  8:32 [PATCH 1/8] regulator: max1586: Remove regulator_dev pointer from state container Krzysztof Kozlowski
2014-03-10  8:32 ` [PATCH 2/8] regulator: max77686: Remove regulator_dev array " Krzysztof Kozlowski
2014-03-10  8:32 ` [PATCH 3/8] regulator: max77693: Remove state container as it is not needed Krzysztof Kozlowski
2014-03-10  9:32   ` Mark Brown
2014-03-10  8:32 ` [PATCH 4/8] regulator: max8649: Remove regulator_dev pointer from state container Krzysztof Kozlowski
2014-03-10  9:33   ` Mark Brown
2014-03-10  8:32 ` [PATCH 5/8] regulator: max8907: Remove regulator_dev array " Krzysztof Kozlowski
2014-03-10  9:35   ` Mark Brown
2014-03-10  8:32 ` [PATCH 6/8] regulator: max8925: Remove unused state container fields Krzysztof Kozlowski
2014-03-10  9:35   ` Mark Brown
2014-03-10  8:32 ` [PATCH 7/8] regulator: max8952: Use managed regulator registration Krzysztof Kozlowski
2014-03-10  9:36   ` Mark Brown
2014-03-10  8:32 ` [PATCH 8/8] regulator: max8973: Remove unused field from 'struct max8973_chip' Krzysztof Kozlowski
2014-03-10  9:36   ` Mark Brown
2014-03-10  9:23 ` [PATCH 1/8] regulator: max1586: Remove regulator_dev pointer from state container Mark Brown
2014-03-10  9:47   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox