aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/anatop-regulator.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>2014-11-10 08:43:53 -0500
committerMark Brown <broonie@kernel.org>2014-11-26 13:58:14 -0500
commit072e78b12bf5182a3e2e460388214a291023ef1c (patch)
treedea7a9970709db752d8b998adcc5615e844ddb87 /drivers/regulator/anatop-regulator.c
parent87e1e0f29f703e91c54e81f05d831432ec659dde (diff)
regulator: of: Add regulator desc param to of_get_regulator_init_data()
The of_get_regulator_init_data() function is used to extract the regulator init_data but information on how to extract certain data is defined in the static regulator descriptor (e.g: how to map the hardware operating modes). Add a const struct regulator_desc * parameter to the function signature so the parsing logic could use the information in the struct regulator_desc. of_get_regulator_init_data() relies on of_get_regulation_constraints() to actually extract the init_data so it has to pass the struct regulator_desc but that is modified on a later patch. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/anatop-regulator.c')
-rw-r--r--drivers/regulator/anatop-regulator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 4f730af70e7c..6eaef9f64420 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -189,17 +189,18 @@ static int anatop_regulator_probe(struct platform_device *pdev)
189 int ret = 0; 189 int ret = 0;
190 u32 val; 190 u32 val;
191 191
192 initdata = of_get_regulator_init_data(dev, np);
193 sreg = devm_kzalloc(dev, sizeof(*sreg), GFP_KERNEL); 192 sreg = devm_kzalloc(dev, sizeof(*sreg), GFP_KERNEL);
194 if (!sreg) 193 if (!sreg)
195 return -ENOMEM; 194 return -ENOMEM;
196 sreg->initdata = initdata;
197 sreg->name = of_get_property(np, "regulator-name", NULL); 195 sreg->name = of_get_property(np, "regulator-name", NULL);
198 rdesc = &sreg->rdesc; 196 rdesc = &sreg->rdesc;
199 rdesc->name = sreg->name; 197 rdesc->name = sreg->name;
200 rdesc->type = REGULATOR_VOLTAGE; 198 rdesc->type = REGULATOR_VOLTAGE;
201 rdesc->owner = THIS_MODULE; 199 rdesc->owner = THIS_MODULE;
202 200
201 initdata = of_get_regulator_init_data(dev, np, rdesc);
202 sreg->initdata = initdata;
203
203 anatop_np = of_get_parent(np); 204 anatop_np = of_get_parent(np);
204 if (!anatop_np) 205 if (!anatop_np)
205 return -ENODEV; 206 return -ENODEV;