Re: [PATCH v8 3/6] iio: adc: ad7192: Add aincom supply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 14, 2024 at 03:02:19PM +0300, Alisa-Dariana Roman wrote:
> AINCOM should actually be a supply. AINx inputs are referenced to AINCOM
> in pseudo-differential operation mode. AINCOM voltage represents the
> offset of corresponding channels.

...

Possible cleanup with the help of

	struct device *dev = &spi->dev;


>  	struct ad7192_state *st;
>  	struct iio_dev *indio_dev;
> +	struct regulator *aincom;
>  	int ret;

...

> +	aincom = devm_regulator_get_optional(&spi->dev, "aincom");

	aincom = devm_regulator_get_optional(dev, "aincom");

...

> +			return dev_err_probe(&spi->dev, PTR_ERR(aincom),
> +					     "Failed to get AINCOM supply\n");

			return dev_err_probe(dev, PTR_ERR(aincom),
					     "Failed to get AINCOM supply\n");

...

> +			return dev_err_probe(&spi->dev, ret,
> +					     "Failed to enable specified AINCOM supply\n");

			return dev_err_probe(dev, ret,
					     "Failed to enable specified AINCOM supply\n");

...

> +		ret = devm_add_action_or_reset(&spi->dev, ad7192_reg_disable, aincom);

		ret = devm_add_action_or_reset(dev, ad7192_reg_disable, aincom);

...

> +			return dev_err_probe(&spi->dev, ret,
> +					     "Device tree error, AINCOM voltage undefined\n");

			return dev_err_probe(dev, ret,
					     "Device tree error, AINCOM voltage undefined\n");

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux