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

Andy Shevchenko <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.