aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps65910-regulator.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/tps65910-regulator.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/tps65910-regulator.c')
-rw-r--r--drivers/regulator/tps65910-regulator.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 4a37c2b6367f..e7a4ece10628 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -1097,6 +1097,7 @@ static int tps65910_set_ext_sleep_config(struct tps65910_reg *pmic,
1097static __devinit int tps65910_probe(struct platform_device *pdev) 1097static __devinit int tps65910_probe(struct platform_device *pdev)
1098{ 1098{
1099 struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent); 1099 struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent);
1100 struct regulator_config config = { };
1100 struct tps_info *info; 1101 struct tps_info *info;
1101 struct regulator_init_data *reg_data; 1102 struct regulator_init_data *reg_data;
1102 struct regulator_dev *rdev; 1103 struct regulator_dev *rdev;
@@ -1206,8 +1207,11 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
1206 pmic->desc[i].type = REGULATOR_VOLTAGE; 1207 pmic->desc[i].type = REGULATOR_VOLTAGE;
1207 pmic->desc[i].owner = THIS_MODULE; 1208 pmic->desc[i].owner = THIS_MODULE;
1208 1209
1209 rdev = regulator_register(&pmic->desc[i], 1210 config.dev = tps65910->dev;
1210 tps65910->dev, reg_data, pmic, NULL); 1211 config.init_data = reg_data;
1212 config.driver_data = pmic;
1213
1214 rdev = regulator_register(&pmic->desc[i], &config);
1211 if (IS_ERR(rdev)) { 1215 if (IS_ERR(rdev)) {
1212 dev_err(tps65910->dev, 1216 dev_err(tps65910->dev,
1213 "failed to register %s regulator\n", 1217 "failed to register %s regulator\n",