From: Mark Brown <broonie@kernel.org>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regulator: core: Add devres versions of regulator_enable/disable
Date: Mon, 12 Aug 2019 12:07:19 +0100 [thread overview]
Message-ID: <20190812110719.GE4592@sirena.co.uk> (raw)
In-Reply-To: <CANhBUQ09+q9_=7nMs63w4KRLGOhW1=z-AnuwOzAnUrWRY6uC6A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 911 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-08-12 11:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 3:03 Chuhong Yuan
2019-08-09 15:11 ` Mark Brown
2019-08-10 1:44 ` Chuhong Yuan
2019-08-12 11:07 ` Mark Brown [this message]
2019-08-12 12:51 ` Chuhong Yuan
2019-08-12 14:19 ` Chuhong Yuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190812110719.GE4592@sirena.co.uk \
--to=broonie@kernel.org \
--cc=hslester96@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®