[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250206112528.00005910@huawei.com>
Date: Thu, 6 Feb 2025 11:25:28 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: "Sperling, Tobias" <Tobias.Sperling@...ting.com>
CC: Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, "linux-iio@...r.kernel.org"
<linux-iio@...r.kernel.org>, "devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] iio: adc: Add driver for ADS7128 / ADS7138
On Tue, 4 Feb 2025 15:50:18 +0000
"Sperling, Tobias" <Tobias.Sperling@...ting.com> 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);
>
>
Powered by blists - more mailing lists