diff options
Diffstat (limited to 'drivers/regulator/ad5398.c')
-rw-r--r-- | drivers/regulator/ad5398.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/ad5398.c b/drivers/regulator/ad5398.c index 9ba69c431da8..46d05f38baf8 100644 --- a/drivers/regulator/ad5398.c +++ b/drivers/regulator/ad5398.c | |||
@@ -212,6 +212,7 @@ static int __devinit ad5398_probe(struct i2c_client *client, | |||
212 | const struct i2c_device_id *id) | 212 | const struct i2c_device_id *id) |
213 | { | 213 | { |
214 | struct regulator_init_data *init_data = client->dev.platform_data; | 214 | struct regulator_init_data *init_data = client->dev.platform_data; |
215 | struct regulator_config config = { }; | ||
215 | struct ad5398_chip_info *chip; | 216 | struct ad5398_chip_info *chip; |
216 | const struct ad5398_current_data_format *df = | 217 | const struct ad5398_current_data_format *df = |
217 | (struct ad5398_current_data_format *)id->driver_data; | 218 | (struct ad5398_current_data_format *)id->driver_data; |
@@ -224,6 +225,10 @@ static int __devinit ad5398_probe(struct i2c_client *client, | |||
224 | if (!chip) | 225 | if (!chip) |
225 | return -ENOMEM; | 226 | return -ENOMEM; |
226 | 227 | ||
228 | config.dev = &client->dev; | ||
229 | config.init_data = init_data; | ||
230 | config.driver_data = chip; | ||
231 | |||
227 | chip->client = client; | 232 | chip->client = client; |
228 | 233 | ||
229 | chip->min_uA = df->min_uA; | 234 | chip->min_uA = df->min_uA; |
@@ -232,8 +237,7 @@ static int __devinit ad5398_probe(struct i2c_client *client, | |||
232 | chip->current_offset = df->current_offset; | 237 | chip->current_offset = df->current_offset; |
233 | chip->current_mask = (chip->current_level - 1) << chip->current_offset; | 238 | chip->current_mask = (chip->current_level - 1) << chip->current_offset; |
234 | 239 | ||
235 | chip->rdev = regulator_register(&ad5398_reg, &client->dev, | 240 | chip->rdev = regulator_register(&ad5398_reg, &config); |
236 | init_data, chip, NULL); | ||
237 | if (IS_ERR(chip->rdev)) { | 241 | if (IS_ERR(chip->rdev)) { |
238 | ret = PTR_ERR(chip->rdev); | 242 | ret = PTR_ERR(chip->rdev); |
239 | dev_err(&client->dev, "failed to register %s %s\n", | 243 | dev_err(&client->dev, "failed to register %s %s\n", |