lkml.org 
[lkml]   [2019]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regulator: core: Add devres versions of regulator_enable/disable
On Sat, Aug 10, 2019 at 09:44:45AM +0800, Chuhong Yuan wrote:
> On Fri, Aug 9, 2019 at 11:11 PM Mark Brown <broonie@kernel.org> wrote:

> > I'm not super keen on managed versions of these functions since they're
> > very likely to cause reference counting issues between the probe/remove
> > path and the suspend/resume path which aren't obvious from the code, I'm
> > especially worried about double frees on release.

> I find that 29 of 31 cases I found call regulator_disable() only when encounter
> probe failure or in .remove.
> So I think the devm versions of regulator_enable/disable() will not cause big
> problems.

There's way more drivers using regulators than that...

> I even found a driver to forget to disable regulator when encounter
> probe failure,
> which is drivers/iio/adc/ti-adc128s052.c.
> And a devm version of regulator_enable() can prevent such mistakes.

Yes, it's useful for that.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-08-12 13:08    [W:0.075 / U:0.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site