On Tue, 14 May 2024 16:13:05 +0300 Andy Shevchenko <andy@xxxxxxxxxx> wrote: > 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; This is a good thing to have as a follow up as it applies much more widely than what is visible in this patch. In ideal world it would have been a precursor to this series, but I don't want to delay this for a v9 just to add that. Hence I'm not going to tweak this whilst applying. Patch applied as is. Thanks, Jonathan > > > > 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"); >