Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74f544c1 authored by Mike Rapoport's avatar Mike Rapoport Committed by Liam Girdwood
Browse files

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: default avatarMike Rapoport <mike@compulab.co.il>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 96186904
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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)