Devicetree
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: David Lechner <dlechner@baylibre.com>
Cc: Marcelo Schmitt <marcelo.schmitt1@gmail.com>,
	Marcelo Schmitt <marcelo.schmitt@analog.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, jic23@kernel.org,
	nuno.sa@analog.com, Michael.Hennerich@analog.com,
	andy@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, julianbraha@gmail.com
Subject: Re: [PATCH v4 2/4] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs
Date: Mon, 29 Jun 2026 19:11:38 +0300	[thread overview]
Message-ID: <akKZOq6DV5x1FvAc@ashevche-desk.local> (raw)
In-Reply-To: <3a96a20c-f435-4b98-9e95-26a28bd06e7b@baylibre.com>

On Mon, Jun 29, 2026 at 10:16:16AM -0500, David Lechner wrote:
> On 6/29/26 9:57 AM, Marcelo Schmitt wrote:

...

> It could use `_offl ? ...` in the macro for that. Not a big deal to me though.

Personally I am for a full spelling here.

...

> >>> +static int ltc2378_regulator_setup(struct device *dev, struct ltc2378_state *st)
> >>> +{
> >>> +	int ret;
> >>> +
> >>> +	ret = devm_regulator_get_enable_read_voltage(dev, "refin");
> >>> +	if (ret < 0 && ret != -ENODEV) {
> >>> +		return dev_err_probe(dev, ret, "failed to read refin regulator\n");
> >>> +	} else if (ret > 0) {
> >>
> >> Else is not needed here.
> > Why not?
> 
> The if returns unconditionally, so else is not needed. This is just a general
> principal.

Unfortunately in this case ENODEV will go further, I don't see full context,
but it may lead to something unexpected.

Personally I prefer the ladder of

	if (ret == -ENODEV)
		...
	else if (ret < 0)
		...
	else
		...

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-06-29 16:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 14:34 [PATCH v4 0/4] iio: adc: Add support for LTC2378 and similar ADCs Marcelo Schmitt
2026-06-25 14:34 ` [PATCH v4 1/4] dt-bindings: iio: adc: Add ltc2378 Marcelo Schmitt
2026-06-25 14:43   ` sashiko-bot
2026-06-25 14:35 ` [PATCH v4 2/4] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs Marcelo Schmitt
2026-06-25 14:47   ` sashiko-bot
2026-06-27 21:24   ` David Lechner
2026-06-29 14:57     ` Marcelo Schmitt
2026-06-29 15:16       ` David Lechner
2026-06-29 16:11         ` Andy Shevchenko [this message]
2026-06-29 17:46           ` Marcelo Schmitt
2026-06-25 14:35 ` [PATCH v4 3/4] iio: adc: ltc2378: Enable high-speed data capture Marcelo Schmitt
2026-06-25 14:52   ` sashiko-bot
2026-06-29  5:49   ` Andy Shevchenko
2026-06-29 17:25     ` Marcelo Schmitt
2026-06-29 17:38       ` Andy Shevchenko
2026-06-25 14:35 ` [PATCH v4 4/4] iio: adc: ltc2378: Enable triggered buffer " Marcelo Schmitt
2026-06-25 15:00   ` sashiko-bot
2026-06-29  5:56   ` Andy Shevchenko
2026-06-27 21:39 ` [PATCH v4 0/4] iio: adc: Add support for LTC2378 and similar ADCs David Lechner
2026-07-01 20:32   ` 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=akKZOq6DV5x1FvAc@ashevche-desk.local \
    --to=andriy.shevchenko@intel.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=jic23@kernel.org \
    --cc=julianbraha@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=marcelo.schmitt@analog.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