Re: [PATCH 7/7] regulator: core: Remove loop disabling supplies in regulator_force_disable()

From: Mark Brown
Date: Tue Nov 20 2018 - 10:55:05 EST


On Mon, Nov 19, 2018 at 04:26:54PM -0800, Douglas Anderson wrote:
> In regulator_force_disable() there was a strange loop that looked like:
>
> while (rdev->open_count--)
> regulator_disable(rdev->supply);
>
> I'm not totally sure what the goal was for this loop, but it seems
> wrong to me. If anything I think maybe we should have been looping
> over our use_count, but even that might be a little strange. For now
> let's just remove the code and we can add something back in if someone
> can explain what's expected.

This should be using use_count, what that loop is doing is dropping all
the enables that the regulator being force disabled had propagated up
all the enables it passed up the chain of supplies.

Attachment: signature.asc
Description: PGP signature