lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMHIzUuNx9LXQdag@lipo>
Date: Wed, 10 Sep 2025 21:51:57 +0300
From: Petre Rodan <petre.rodan@...dimension.ro>
To: Jonathan Cameron <jic23@...nel.org>
Cc: David Lechner <dlechner@...libre.com>,
	Nuno Sá <nuno.sa@...log.com>,
	Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>,
	linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 06/14] iio: accel: bma220: add get regulator check


Hello Jonathan,

thank you for the blazing fast feedback!

On Wed, Sep 10, 2025 at 06:58:41PM +0100, Jonathan Cameron wrote:
> On Wed, 10 Sep 2025 10:57:11 +0300
> Petre Rodan <petre.rodan@...dimension.ro> wrote:
> 
> I don't follow the 'add get regulator check' of the patch description.
> This is ensuring they are powered up if necessary.  So I'd
> just go with the vague: "turn power supplies on"

to be honest I added this just because I've seen the devm_regulator_bulk_get_enable() function used all over the place in iio code.
but looking at the linux/regulator/consumers.h header I was more puzzled.
just some forward declarations and then static functions doing exactly nothing.
I'm afraid to ask what that is all about. placeholder for a future API?

best regards,
peter

> > +#include <linux/regulator/consumer.h>
> >  #include <linux/types.h>
> >  #include <linux/spi/spi.h>
> >  
> > @@ -205,6 +206,13 @@ static const struct iio_info bma220_info = {
> >  static int bma220_init(struct spi_device *spi)
> >  {
> >  	int ret;
> > +	static const char * const regulator_names[] = { "vddd", "vddio", "vdda" };
> > +
> > +	ret = devm_regulator_bulk_get_enable(&spi->dev,
> > +					     ARRAY_SIZE(regulator_names),
> > +					     regulator_names);
> > +	if (ret)
> > +		return dev_err_probe(&spi->dev, ret, "Failed to get regulators\n");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ