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: <aLb9zgkE0TVZiOmp@smile.fi.intel.com>
Date: Tue, 2 Sep 2025 17:23:10 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: David Lechner <dlechner@...libre.com>
Cc: Marilene Andrade Garcia <marilene.agarcia@...il.com>,
	linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
	devicetree@...r.kernel.org,
	Kim Seer Paller <kimseer.paller@...log.com>,
	Jonathan Cameron <jic23@...nel.org>,
	Nuno Sá <nuno.sa@...log.com>,
	Andy Shevchenko <andy@...nel.org>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Michael Hennerich <Michael.Hennerich@...log.com>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Marcelo Schmitt <marcelo.schmitt1@...il.com>,
	Marcelo Schmitt <Marcelo.Schmitt@...log.com>,
	Ceclan Dumitru <dumitru.ceclan@...log.com>,
	Jonathan Santos <Jonathan.Santos@...log.com>,
	Dragos Bogdan <dragos.bogdan@...log.com>
Subject: Re: [PATCH v10 2/2] iio: adc: max14001: New driver

On Tue, Sep 02, 2025 at 09:12:08AM -0500, David Lechner wrote:
> On 9/2/25 8:45 AM, Andy Shevchenko wrote:

...

> >> +	ret = devm_regulator_get_enable_read_voltage(dev, "vrefin");
> >> +	if (ret < 0) {
> >> +		st->vref_mv = 1250000 / 1000;
> > 
> > (MICRO / MILLI)
> > 
> >> +	} else {
> >> +		st->vref_mv = ret / 1000;
> > 
> > Ditto.
> > 
> >> +		ext_vrefin = 1;
> >> +	}
> > 
> > And with deduplication refactored code:
> > 
> > 	ret = devm_regulator_get_enable_read_voltage(dev, "vrefin");
> 
> 	if (ret < 0 && ret != -ENODEV)
> 		return dev_err_probe(dev, ret, "Failed to get REFIN voltage\n");
> 
> Most errors should be propagated, so we should also add this.
> Only -ENODEV means that the supply was omitted from the devicetree
> and we should use the internal reference voltage.

Good point.

> > 	if (ret < 0)
> > 		ret = 1250000;
> > 	else
> > 		ext_vrefin = 1;
> > 	st->vref_mv = ret / (MICRO / MILLI);

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ