Patrick Rudolph b051d9bf98 regulator: core: Prevent integer underflow
[ Upstream commit 8d8e16592022c9650df8aedfe6552ed478d7135b ]

By using a ratio of delay to poll_enabled_time that is not integer
time_remaining underflows and does not exit the loop as expected.
As delay could be derived from DT and poll_enabled_time is defined
in the driver this can easily happen.

Use a signed iterator to make sure that the loop exits once
the remaining time is negative.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20220909125954.577669-1-patrick.rudolph@9elements.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:25:46 +02:00
..
2022-10-26 13:25:40 +02:00
2022-10-26 13:25:09 +02:00
2022-10-26 13:25:22 +02:00
2022-05-09 09:04:56 +02:00
2022-04-13 21:00:55 +02:00
2022-08-25 11:38:14 +02:00