Re: [PATCH 2/2] iio: adc: Add driver for ADS7128 / ADS7138

From: Jonathan Cameron
Date: Thu Feb 06 2025 - 06:25:56 EST


On Tue, 4 Feb 2025 15:50:18 +0000
"Sperling, Tobias" <Tobias.Sperling@xxxxxxxxxxx> wrote:

> Just one more question, as I've received a mail from the kernel test robot.
> It reported two warnings regarding following unused functions
> ads71x8_runtime_suspend() and ads71x8_runtime_resume().
> I guess this is due PM not being used necessarily. So do I still have to use
> #ifdef CONFIG_PM or what did I miss there?
>
> static int ads71x8_runtime_suspend(struct device *dev)
> {
> struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct ads71x8_data *data = iio_priv(indio_dev);
>
> return ads71x8_set_conv_mode(data, ADS71x8_MODE_MANUAL);
> }
>
> static int ads71x8_runtime_resume(struct device *dev)
> {
> struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct ads71x8_data *data = iio_priv(indio_dev);
>
> return ads71x8_set_conv_mode(data, ADS71x8_MODE_AUTO);
> }
>
> static const struct dev_pm_ops ads71x8_pm_ops = {
> SET_RUNTIME_PM_OPS(ads71x8_runtime_suspend, ads71x8_runtime_resume, NULL)

Using SET_RUNTIME_PM_OPS() breaks the chain of references. Use
RUNTIME_PM_OPS() instead.


> };
>
> ....
>
> static struct i2c_driver ads71x8_driver = {
> .driver = {
> .name = "ads7138",
> .of_match_table = ads71x8_of_match,
> .pm = pm_ptr(&ads71x8_pm_ops),

> },
> .id_table = ads71x8_device_ids,
> .probe = ads71x8_probe,
> };
> module_i2c_driver(ads71x8_driver);
>
>