Messages in this thread | | | Date | Thu, 30 Aug 2012 11:27:58 -0700 | From | Mark Brown <> | Subject | Re: [PATCH V2] regulator: disable supply regulator if it is enabled for boot-on |
| |
On Thu, Aug 30, 2012 at 08:24:15PM +0200, Rabin Vincent wrote:
> This does not handle the case where a regulator is not set boot_on but > is considered on (for example, because of the lack of an is_enabled > callback), and is later actually enabled by a consumer before > regulator_init_complete(). In this case, the supply's use count will > still be one more than it should be, because the "&& c->boot_on" > condition above will fail.
> To fix this, you should probably note which regulators' supplies you > enable in regulator_register() and use that information in the above two > checks here in regulator_init_complete().
Yeah, I didn't read this properly yet but this was my main concern - this should all just fall out naturally through the normal disable process. Doing special case bodges feels really fragile and error prone.
| |