aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8649.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-03 19:50:22 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-09 07:37:09 -0400
commitc172708d38a401b2f3f841dfcd862b469fa0b670 (patch)
tree75e89c63fd0c76a2c69bb5ad6e45b3762bceb6b6 /drivers/regulator/max8649.c
parent1474e4dbcae04125ed6e503eadcef266846f4675 (diff)
regulator: core: Use a struct to pass in regulator runtime configuration
Rather than adding new arguments to regulator_register() every time we want to add a new bit of dynamic information at runtime change the function to take these via a struct. By doing this we avoid needing to do further changes like the recent addition of device tree support which required each regulator driver to be updated to take an additional parameter. The regulator_desc which should (mostly) be static data is still passed separately as most drivers are able to configure this statically at build time. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/max8649.c')
-rw-r--r--drivers/regulator/max8649.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c
index dca7835b381c..991f517c8dc8 100644
--- a/drivers/regulator/max8649.c
+++ b/drivers/regulator/max8649.c
@@ -225,6 +225,7 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client,
225{ 225{
226 struct max8649_platform_data *pdata = client->dev.platform_data; 226 struct max8649_platform_data *pdata = client->dev.platform_data;
227 struct max8649_regulator_info *info = NULL; 227 struct max8649_regulator_info *info = NULL;
228 struct regulator_config config = { };
228 unsigned int val; 229 unsigned int val;
229 unsigned char data; 230 unsigned char data;
230 int ret; 231 int ret;
@@ -297,8 +298,11 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client,
297 MAX8649_RAMP_DOWN); 298 MAX8649_RAMP_DOWN);
298 } 299 }
299 300
300 info->regulator = regulator_register(&dcdc_desc, &client->dev, 301 config.dev = &client->dev;
301 pdata->regulator, info, NULL); 302 config.init_data = pdata->regulator;
303 config.driver_data = info;
304
305 info->regulator = regulator_register(&dcdc_desc, &config);
302 if (IS_ERR(info->regulator)) { 306 if (IS_ERR(info->regulator)) {
303 dev_err(info->dev, "failed to register regulator %s\n", 307 dev_err(info->dev, "failed to register regulator %s\n",
304 dcdc_desc.name); 308 dcdc_desc.name);