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

Commit e36c1df8 authored by Axel Lin's avatar Axel Lin Committed by Liam Girdwood
Browse files

regulator: Ensure enough delay time for enabling regulator



Integer division will truncate the result, this patch ensures we have
enough delay time for enabling regulator.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent aa7a7404
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1312,10 +1312,12 @@ static int _regulator_enable(struct regulator_dev *rdev)
			if (ret < 0)
				return ret;

			if (delay >= 1000)
			if (delay >= 1000) {
				mdelay(delay / 1000);
			else if (delay)
				udelay(delay % 1000);
			} else if (delay) {
				udelay(delay);
			}

		} else if (ret < 0) {
			printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",