From: Sanjay Chitroda <sanjayembeddedse@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: accel: mma8452: use pm_ptr() for dev_pm_ops
Date: Tue, 21 Apr 2026 07:23:06 +0530 [thread overview]
Message-ID: <67B89EF1-C05C-4317-8E8A-A8DB87748457@gmail.com> (raw)
In-Reply-To: <CAMuHMdXCYxrCoi7zdUfmbgxXwdwiSKB3YczG-odUQLgvUJ9HQA@mail.gmail.com>
On 20 April 2026 1:36:14 pm IST, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>Hi Sanjay,
>
>On Tue, 14 Apr 2026 at 21:20, Sanjay Chitroda
><sanjayembeddedse@gmail.com> wrote:
>> From: Sanjay Chitroda <sanjayembeddedse@gmail.com>
>>
>> Use pm_ptr() so the PM ops pointer is automatically set to
>> NULL when CONFIG_PM is disabled. This avoids unused-function warnings
>> and follows modern kernel power-management conventions.
>>
>> Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
>
>Thanks for your patch!
>
>> --- a/drivers/iio/accel/mma8452.c
>> +++ b/drivers/iio/accel/mma8452.c
>> @@ -1744,7 +1744,6 @@ static void mma8452_remove(struct i2c_client *client)
>> regulator_disable(data->vdd_reg);
>> }
>>
>> -#ifdef CONFIG_PM
>> static int mma8452_runtime_suspend(struct device *dev)
>> {
>> struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
>> @@ -1812,7 +1811,6 @@ static int mma8452_runtime_resume(struct device *dev)
>>
>> return ret;
>> }
>> -#endif
>>
>> static const struct dev_pm_ops mma8452_pm_ops = {
>> SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
>
>You are still getting defined but not used warnings, as reported by
>the kernel test robot, due to the use of SET_SYSTEM_SLEEP_PM_OPS()
>and SET_RUNTIME_PM_OPS(). Please define the structure using
>DEFINE_RUNTIME_DEV_PM_OPS() to fix this.
>
>> @@ -1835,7 +1833,7 @@ static struct i2c_driver mma8452_driver = {
>> .driver = {
>> .name = "mma8452",
>> .of_match_table = mma8452_dt_ids,
>> - .pm = &mma8452_pm_ops,
>> + .pm = pm_ptr(&mma8452_pm_ops),
>> },
>> .probe = mma8452_probe,
>> .remove = mma8452_remove,
>
>Gr{oetje,eeting}s,
>
> Geert
>
Hi Greet,
Thank you for the review and feedback.
I will update changes in next version.
Thank,
Sanjay Chitroda
next prev parent reply other threads:[~2026-04-21 1:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 19:20 [PATCH] iio: accel: mma8452: use pm_ptr() for dev_pm_ops Sanjay Chitroda
2026-04-15 9:42 ` Andy Shevchenko
2026-04-21 1:53 ` Sanjay Chitroda
2026-04-16 15:33 ` kernel test robot
2026-04-20 8:06 ` Geert Uytterhoeven
2026-04-21 1:53 ` Sanjay Chitroda [this message]
2026-04-21 15:24 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67B89EF1-C05C-4317-8E8A-A8DB87748457@gmail.com \
--to=sanjayembeddedse@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=geert@linux-m68k.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox