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: <aJO36Ul5ozQaJUkH@smile.fi.intel.com>
Date: Wed, 6 Aug 2025 23:15:37 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Stefano Manni <stefano.manni@...il.com>
Cc: lars@...afoo.de, Michael.Hennerich@...log.com, jic23@...nel.org,
	dlechner@...libre.com, nuno.sa@...log.com, andy@...nel.org,
	linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] iio: adc: ad799x: add reference voltage capability
 to chip_info

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



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ