aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8952.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/max8952.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/max8952.c')
-rw-r--r--drivers/regulator/max8952.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c
index b4084314c222..c0ab4ddc1023 100644
--- a/drivers/regulator/max8952.c
+++ b/drivers/regulator/max8952.c
@@ -173,6 +173,7 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
173{ 173{
174 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); 174 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
175 struct max8952_platform_data *pdata = client->dev.platform_data; 175 struct max8952_platform_data *pdata = client->dev.platform_data;
176 struct regulator_config config = { };
176 struct max8952_data *max8952; 177 struct max8952_data *max8952;
177 178
178 int ret = 0, err = 0; 179 int ret = 0, err = 0;
@@ -193,8 +194,11 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
193 max8952->dev = &client->dev; 194 max8952->dev = &client->dev;
194 max8952->pdata = pdata; 195 max8952->pdata = pdata;
195 196
196 max8952->rdev = regulator_register(&regulator, max8952->dev, 197 config.dev = max8952->dev;
197 &pdata->reg_data, max8952, NULL); 198 config.init_data = &pdata->reg_data;
199 config.driver_data = max8952;
200
201 max8952->rdev = regulator_register(&regulator, &config);
198 202
199 if (IS_ERR(max8952->rdev)) { 203 if (IS_ERR(max8952->rdev)) {
200 ret = PTR_ERR(max8952->rdev); 204 ret = PTR_ERR(max8952->rdev);