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

Commit 2437fccf authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull regulator fix from Mark Brown:
 "A smallish fix for a lock dependency issue which affects a bunch of
  Qualcomm boards that do unusually complicated things with their
  regulators, the API is unlikely to be called by any other system."

* tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Fix recursive mutex lockdep warning
parents 6c6ee53c d92d95b6
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -2519,9 +2519,12 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
{
{
	struct regulator_dev *rdev = regulator->rdev;
	struct regulator_dev *rdev = regulator->rdev;
	struct regulator *consumer;
	struct regulator *consumer;
	int ret, output_uV, input_uV, total_uA_load = 0;
	int ret, output_uV, input_uV = 0, total_uA_load = 0;
	unsigned int mode;
	unsigned int mode;


	if (rdev->supply)
		input_uV = regulator_get_voltage(rdev->supply);

	mutex_lock(&rdev->mutex);
	mutex_lock(&rdev->mutex);


	/*
	/*
@@ -2554,10 +2557,7 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
		goto out;
		goto out;
	}
	}


	/* get input voltage */
	/* No supply? Use constraint voltage */
	input_uV = 0;
	if (rdev->supply)
		input_uV = regulator_get_voltage(rdev->supply);
	if (input_uV <= 0)
	if (input_uV <= 0)
		input_uV = rdev->constraints->input_uV;
		input_uV = rdev->constraints->input_uV;
	if (input_uV <= 0) {
	if (input_uV <= 0) {