Re: [PATCH v3 5/5] iio: amplifiers: ada4250: use dev_err_probe()

From: David Lechner
Date: Thu Jun 12 2025 - 11:41:58 EST


On 6/12/25 8:05 AM, Andy Shevchenko wrote:
> On Wed, Jun 11, 2025 at 04:33:05PM -0500, David Lechner wrote:
>> Use dev_err_probe() when returning an error in the probe function.
>
> ...
>
>> mutex_init(&st->lock);
>
> Side note. Switch to devm?

Yup, missed that.

>
> ...
>
>> ret = ada4250_init(st);
>
> Is this used only in ->probe() stage? If so, please also move to
> dev_err_probe() there.

After all of the other changes, there was nothing left to convert
to dev_err_probe() there.

>
>> - if (ret) {
>> - dev_err(&spi->dev, "ADA4250 init failed\n");
>> - return ret;
>> - }
>> + if (ret)
>> + return dev_err_probe(&spi->dev, ret, "ADA4250 init failed\n");
>>
>> return devm_iio_device_register(&spi->dev, indio_dev);
>