All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Stefano Manni <stefano.manni@gmail.com>
Cc: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: adc: ad799x: add reference voltage capability to chip_info
Date: Wed, 6 Aug 2025 23:15:37 +0300	[thread overview]
Message-ID: <aJO36Ul5ozQaJUkH@smile.fi.intel.com> (raw)
In-Reply-To: <20250806090158.117628-2-stefano.manni@gmail.com>

On Wed, Aug 06, 2025 at 11:01:57AM +0200, Stefano Manni wrote:
> If the chip supports an external reference voltage
> on REFIN pin then the "vref-supply" regulator may be used.
> 
> This commit partially refactors 6b104e7895ab16b9b7f466c5f2ca282b87f661e8
> to add the capability of the chip to have an external
> voltage reference and then remove the ugly conditional check
> on chip id.

Suggested-by?

...

> +	if (chip_info->has_vref) {
> +		st->vref = devm_regulator_get_optional(&client->dev, "vref");

> +

Redundant blank line.

> +		if (IS_ERR(st->vref)) {
> +			if (PTR_ERR(st->vref) == -ENODEV) {
> +				st->vref = NULL;
> +				dev_info(&client->dev, "Using VCC reference voltage\n");
> +			} else {
> +				ret = PTR_ERR(st->vref);
> +				goto error_disable_reg;
> +			}
>  		}

Can be written as

		ret = PTR_ERR_OR_ZERO(st->vref);
		if (ret) {
			if (ret != -ENODEV)
				goto error_disable_reg;
			st->vref = NULL;
			dev_info(&client->dev, "Using VCC reference voltage\n");
		}

> -	}


-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2025-08-06 20:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  9:01 [PATCH 0/2] iio: adc: ad799x: reference voltage capability Stefano Manni
2025-08-06  9:01 ` [PATCH 1/2] iio: adc: ad799x: add reference voltage capability to chip_info Stefano Manni
2025-08-06 14:58   ` Jonathan Cameron
2025-08-06 15:36     ` David Lechner
2025-08-06 20:15   ` Andy Shevchenko [this message]
2025-08-06  9:01 ` [PATCH 2/2] iio: adc: ad799x: add reference voltage to ad7994 Stefano Manni
2025-08-06 20:16   ` Andy Shevchenko
2025-08-06 15:40 ` [PATCH 0/2] iio: adc: ad799x: reference voltage capability David Lechner
2025-08-06 20:06 ` Andy Shevchenko

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=aJO36Ul5ozQaJUkH@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=stefano.manni@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.