Re: [PATCH v3 3/6] regulator: core: Add helper for allow access to enable register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 11, 2024 at 12:03:59PM +0100, Biju Das wrote:
> Add a helper function that allow regulator consumers to allow low-level
> enable register access, in order to enable/disable regulator in atomic
> context.

> +To access the hardware register for enabling/disabling the regulator, use::
> +
> +	int regulator_set_hardware_enable_register(struct regulator *regulator,
> +						   bool enable);

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.

Also it's not sure about that name, if we were doing this it should be
more describing the effect on the regulator rather than this happening
to be done via a register write (this should also work for GPIOs...).

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux