Commit d914d81b authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: Convert anatop to use a struct to pass in regulator runtime configuration

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 0cb2f123
...@@ -122,6 +122,7 @@ static int __devinit anatop_regulator_probe(struct platform_device *pdev) ...@@ -122,6 +122,7 @@ static int __devinit anatop_regulator_probe(struct platform_device *pdev)
struct anatop_regulator *sreg; struct anatop_regulator *sreg;
struct regulator_init_data *initdata; struct regulator_init_data *initdata;
struct anatop *anatopmfd = dev_get_drvdata(pdev->dev.parent); struct anatop *anatopmfd = dev_get_drvdata(pdev->dev.parent);
struct regulator_config config = { };
int ret = 0; int ret = 0;
initdata = of_get_regulator_init_data(dev, np); initdata = of_get_regulator_init_data(dev, np);
...@@ -178,9 +179,13 @@ static int __devinit anatop_regulator_probe(struct platform_device *pdev) ...@@ -178,9 +179,13 @@ static int __devinit anatop_regulator_probe(struct platform_device *pdev)
rdesc->n_voltages = (sreg->max_voltage - sreg->min_voltage) rdesc->n_voltages = (sreg->max_voltage - sreg->min_voltage)
/ 25000 + 1; / 25000 + 1;
config.dev = &pdev->dev;
config.init_data = initdata;
config.driver_data = sreg;
config.of_node = pdev->dev.of_node;
/* register regulator */ /* register regulator */
rdev = regulator_register(rdesc, dev, rdev = regulator_register(rdesc, &config);
initdata, sreg, pdev->dev.of_node);
if (IS_ERR(rdev)) { if (IS_ERR(rdev)) {
dev_err(dev, "failed to register %s\n", dev_err(dev, "failed to register %s\n",
rdesc->name); rdesc->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment