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

Commit 8b96de31 authored by Philip Rakity's avatar Philip Rakity Committed by Mark Brown
Browse files

regulator: core.c Only delay when setting voltage requires this



minor optimization: move delay code to where delay is set and
thus where it is used vs in the main line path.

Signed-off-by: default avatarPhilip Rakity <prakity@marvell.com>
Acked-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 2f7baf89
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2155,7 +2155,6 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
				  delay);
			delay = 0;
		}
	}

		/* Insert any necessary delays */
		if (delay >= 1000) {
@@ -2164,6 +2163,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
		} else if (delay) {
			udelay(delay);
		}
	}

	if (ret == 0 && best_val >= 0)
		_notifier_call_chain(rdev, REGULATOR_EVENT_VOLTAGE_CHANGE,