mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: David Lechner <dlechner@baylibre.com>
Cc: "Marilene Andrade Garcia" <marilene.agarcia@gmail.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org,
	"Kim Seer Paller" <kimseer.paller@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Marcelo Schmitt" <marcelo.schmitt1@gmail.com>,
	"Marcelo Schmitt" <Marcelo.Schmitt@analog.com>,
	"Ceclan Dumitru" <dumitru.ceclan@analog.com>,
	"Jonathan Santos" <Jonathan.Santos@analog.com>,
	"Dragos Bogdan" <dragos.bogdan@analog.com>
Subject: Re: [PATCH v10 2/2] iio: adc: max14001: New driver
Date: Tue, 2 Sep 2025 17:23:10 +0300	[thread overview]
Message-ID: <aLb9zgkE0TVZiOmp@smile.fi.intel.com> (raw)
In-Reply-To: <0cc072ab-dbf6-40fb-b753-13453b904974@baylibre.com>

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



  reply	other threads:[~2025-09-02 14:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 13:14 [PATCH v10 0/2] Add MAX14001/MAX14002 support Marilene Andrade Garcia
2025-09-02 13:15 ` [PATCH v10 1/2] dt-bindings: iio: adc: add max14001 Marilene Andrade Garcia
2025-09-02 14:29   ` David Lechner
2025-09-02 15:30     ` David Lechner
2025-09-02 19:42     ` Conor Dooley
2025-09-02 13:16 ` [PATCH v10 2/2] iio: adc: max14001: New driver Marilene Andrade Garcia
2025-09-02 13:45   ` Andy Shevchenko
2025-09-02 14:12     ` David Lechner
2025-09-02 14:23       ` Andy Shevchenko [this message]
2025-09-02 15:44   ` David Lechner
2025-09-03 22:28   ` kernel test robot
2025-09-02 16:10 ` [PATCH v10 0/2] Add MAX14001/MAX14002 support David Lechner
2025-09-03 16:11   ` Jonathan Cameron

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=aLb9zgkE0TVZiOmp@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=Jonathan.Santos@analog.com \
    --cc=Marcelo.Schmitt@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=dragos.bogdan@analog.com \
    --cc=dumitru.ceclan@analog.com \
    --cc=jic23@kernel.org \
    --cc=kimseer.paller@analog.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=marilene.agarcia@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /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®