[PATCH v3 3/6] regulator: core: Add helper for allow access to enable register
Mark Brown
broonie at kernel.org
Wed Jun 12 08:50:24 PDT 2024
On Tue, Jun 11, 2024 at 04:28:37PM +0000, Biju Das wrote:
> > So, it'll doubtless not be a surprise that I'm not thrilled with this - it's basically just
> > punching a hole straight through all the locking and reference counting in a way that's just
> > begging for abuse. At the very least we should have a check for exclusive access in there.
> Do you mean exclusive access by means of spinlock to avoid race between enable/disable()?
> If that is the case
No, I mean regulator_get_exclusive(), this clearly can't work if there's
more than one consumer.
> > Also it's not sure about that name, if we were doing this it should be more describing the effect
> What about the name regulator_hardware_enable() to make it generic??
Possibly.
> > on the regulator rather than this happening to be done via a register write (this should also work
> > for GPIOs...).
> Do you mean to make it generic, so that it works for both regmap based enable/disable() as well as
> gpio based enable()/disable()??
That too, I was mainly thinking about the name here though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-phy/attachments/20240612/b44a333d/attachment.sig>
More information about the linux-phy
mailing list