mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: matti.vaittinen@fi.rohmeurope.com,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/7] regulator: Add devm helpers for get and enable
Date: Thu, 11 Aug 2022 07:50:49 +0300	[thread overview]
Message-ID: <b17dccb5-79f1-a70b-37f6-129e20f27cfc@gmail.com> (raw)
In-Reply-To: <YvPLx5hizWMEBjVK@sirena.org.uk>

On 8/10/22 18:16, Mark Brown wrote:
> On Wed, Aug 10, 2022 at 03:19:05PM +0300, Matti Vaittinen wrote:
> 
>> In order to tackle the issue the suggested API does not return handle to the
>> regulators - it really just provides the "get'n enable, then forget"
>> solution. The consumers who use the suggested API to "devm get'n enable"
>> will have had time manually controlling the regulator afterwards as they
>> will not get the handle. I would almost claim that the pattern we nowadays
>> see (devm_get, enable, add_action_or_reset(disable())) is more error prone
>> as users seem to in many case be storing the regulator handle w/o any
>> comment about the automated disable at detach.
> 
> Hrm, right - that does help with that case.  However we do need a bulk
> version since that's an obvious problem case.
I'll take a look at the bulk APIs and add them if they're not too 
complex. I'm a bit short on time as I was told I should be doing 
something we can show to a customer ;)

As a result of this discussion - not returning the handle to struct 
regulator * sounds like a safest option here. I'll drop the RFC when I 
respin this (hopefully with the bulk-APIs and a few more converted drivers)

Thanks for the input!

Best Regards
	Matti Vaittinen

-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~

Discuss - Estimate - Plan - Report and finally accomplish this:
void do_work(int time) __attribute__ ((const));

  reply	other threads:[~2022-08-11  4:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 11:21 [RFC PATCH 0/7] Devm helpers for regulator " Matti Vaittinen
2022-08-10 11:29 ` [RFC PATCH 1/7] docs: devres: regulator: Add missing devm_* functions to devres.rst Matti Vaittinen
2022-08-10 11:29 ` [RFC PATCH 2/7] regulator: Add devm helpers for get and enable Matti Vaittinen
2022-08-10 11:56   ` Mark Brown
2022-08-10 12:19     ` Matti Vaittinen
2022-08-10 15:16       ` Mark Brown
2022-08-11  4:50         ` Matti Vaittinen [this message]
2022-08-10 11:30 ` [RFC PATCH 3/7] docs: devres: regulator: Add new get_enable functions to devres.rst Matti Vaittinen
2022-08-10 11:31 ` [RFC PATCH 4/7] clk: cdce925: simplify using devm_regulator_get_enable() Matti Vaittinen
2022-08-10 11:31 ` [RFC PATCH 5/7] gpu: drm: meson: simplify using devm_regulator_get_enable_optional() Matti Vaittinen
2022-08-10 11:32 ` [RFC PATCH 6/7] hwmon: lm90: simplify using devm_regulator_get_enable() Matti Vaittinen
2022-08-10 12:52   ` Guenter Roeck
2022-08-10 11:32 ` [RFC PATCH 7/7] adc: ad7192: " Matti Vaittinen

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=b17dccb5-79f1-a70b-37f6-129e20f27cfc@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    /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®