aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-03-10 04:32:44 -0400
committerMark Brown <broonie@linaro.org>2014-03-10 05:22:51 -0400
commitaaa46b4b1af9f873cccdfe7966d3eda67e43f044 (patch)
tree4841ba7cb01774073cc5da95d96acf564e88b17c
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
regulator: max1586: Remove regulator_dev pointer from state container
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> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/regulator/max1586.c12
1 files 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 {
46 46
47 unsigned int v3_curr_sel; 47 unsigned int v3_curr_sel;
48 unsigned int v6_curr_sel; 48 unsigned int v6_curr_sel;
49
50 struct regulator_dev *rdev[0];
51}; 49};
52 50
53/* 51/*
@@ -162,7 +160,6 @@ static struct regulator_desc max1586_reg[] = {
162static int max1586_pmic_probe(struct i2c_client *client, 160static int max1586_pmic_probe(struct i2c_client *client,
163 const struct i2c_device_id *i2c_id) 161 const struct i2c_device_id *i2c_id)
164{ 162{
165 struct regulator_dev **rdev;
166 struct max1586_platform_data *pdata = dev_get_platdata(&client->dev); 163 struct max1586_platform_data *pdata = dev_get_platdata(&client->dev);
167 struct regulator_config config = { }; 164 struct regulator_config config = { };
168 struct max1586_data *max1586; 165 struct max1586_data *max1586;
@@ -186,8 +183,9 @@ static int max1586_pmic_probe(struct i2c_client *client,
186 max1586->v3_curr_sel = 24; /* 1.3V */ 183 max1586->v3_curr_sel = 24; /* 1.3V */
187 max1586->v6_curr_sel = 0; 184 max1586->v6_curr_sel = 0;
188 185
189 rdev = max1586->rdev;
190 for (i = 0; i < pdata->num_subdevs && i <= MAX1586_V6; i++) { 186 for (i = 0; i < pdata->num_subdevs && i <= MAX1586_V6; i++) {
187 struct regulator_dev *rdev;
188
191 id = pdata->subdevs[i].id; 189 id = pdata->subdevs[i].id;
192 if (!pdata->subdevs[i].platform_data) 190 if (!pdata->subdevs[i].platform_data)
193 continue; 191 continue;
@@ -207,12 +205,12 @@ static int max1586_pmic_probe(struct i2c_client *client,
207 config.init_data = pdata->subdevs[i].platform_data; 205 config.init_data = pdata->subdevs[i].platform_data;
208 config.driver_data = max1586; 206 config.driver_data = max1586;
209 207
210 rdev[i] = devm_regulator_register(&client->dev, 208 rdev = devm_regulator_register(&client->dev,
211 &max1586_reg[id], &config); 209 &max1586_reg[id], &config);
212 if (IS_ERR(rdev[i])) { 210 if (IS_ERR(rdev)) {
213 dev_err(&client->dev, "failed to register %s\n", 211 dev_err(&client->dev, "failed to register %s\n",
214 max1586_reg[id].name); 212 max1586_reg[id].name);
215 return PTR_ERR(rdev[i]); 213 return PTR_ERR(rdev);
216 } 214 }
217 } 215 }
218 216