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>
goto clean;
}
- /* set regulator constraints */
- ret = set_machine_constraints(rdev, &init_data->constraints);
- if (ret < 0)
- goto clean;
-
/* register with sysfs */
rdev->dev.class = ®ulator_class;
rdev->dev.parent = dev;
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)