Re: [PATCH v3 5/8] iio: adc: ti-ads1015: use dev_err_probe() for error handling

From: Andy Shevchenko

Date: Thu Aug 13 2026 - 04:56:07 EST


On Wed, Aug 12, 2026 at 10:14:30PM +0530, Archit Anant wrote:
> Simplify the error handling paths in ads1015_probe() and
> ads1015_client_get_channels_config() by converting dev_err()
> calls that are immediately followed by a return statement
> over to the modern dev_err_probe() helper.
>
> Note: This patch takes advantage of the previously introduced
> local 'dev' pointer when converting the legacy
> dev_err(&client->dev, ...) calls, avoiding unnecessary
> code churn.

...

> ret = iio_device_register(indio_dev);
> if (ret < 0) {
> - dev_err(&client->dev, "Failed to register IIO device\n");
> pm_runtime_disable(dev);
> pm_runtime_set_suspended(dev);
> - return ret;

This shows that runtime PM calls were put to the wrong place in the previous
patch. Just move them to be up, then this will be naturally accepted change.

> + return dev_err_probe(dev, ret,
> + "Failed to register IIO device\n");
> }

--
With Best Regards,
Andy Shevchenko