aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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