Re: [PATCH] iio: accel: mma8452: use pm_ptr() for dev_pm_ops
From: Andy Shevchenko
Date: Wed Apr 15 2026 - 05:43:25 EST
On Wed, Apr 15, 2026 at 12:50:45AM +0530, Sanjay Chitroda wrote:
> 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.
...
> static const struct dev_pm_ops mma8452_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
You also want to change this to DEFINE_RUNTIME_DEV_PM_OPS().
--
With Best Regards,
Andy Shevchenko