summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2008-11-25 13:53:53 +0100
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-01-08 21:10:31 +0100
commit74f544c1fc0339acf6f66ff438b8543b1f9faf10 (patch)
tree6e4a4739e78acde8534c23848970e694dc0b73a8 /drivers/regulator
parentregulator: da903x: make da903x_is_enabled return 0 or 1 (diff)
downloadlinux-74f544c1fc0339acf6f66ff438b8543b1f9faf10.tar.xz
linux-74f544c1fc0339acf6f66ff438b8543b1f9faf10.zip
regulator: move set_machine_constraints after regulator device initialization
Calling set_machine_constraints before regulator device initialization causes crash when constraints have apply_uV set. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9a5ff97d158d..895f73887cf0 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1858,11 +1858,6 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
goto clean;
}
- /* set regulator constraints */
- ret = set_machine_constraints(rdev, &init_data->constraints);
- if (ret < 0)
- goto clean;
-
/* register with sysfs */
rdev->dev.class = &regulator_class;
rdev->dev.parent = dev;
@@ -1874,6 +1869,11 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
dev_set_drvdata(&rdev->dev, rdev);
+ /* set regulator constraints */
+ ret = set_machine_constraints(rdev, &init_data->constraints);
+ if (ret < 0)
+ goto scrub;
+
/* add attributes supported by this regulator */
ret = add_regulator_attributes(rdev);
if (ret < 0)