Re: [PATCH] iio: cros_ec: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

From: Andy Shevchenko

Date: Fri Aug 21 2026 - 09:41:45 EST


On Fri, Aug 21, 2026 at 08:44:54AM +0700, Triet Hoang wrote:
> Convert the deprecated SIMPLE_DEV_PM_OPS
> to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().
>
> This lets us drop the __maybe_unused annotations
> from the resume callbacks, and reduces kernel size
> in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

There is room on the lines to make them longer a bit.

Convert the deprecated SIMPLE_DEV_PM_OPS to DEFINE_SIMPLE_DEV_PM_OPS
and pm_sleep_ptr().

This lets us drop the __maybe_unused annotations from the resume callbacks,
and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.


...

> -SIMPLE_DEV_PM_OPS(cros_ec_sensors_pm_ops, NULL, cros_ec_sensors_resume);
> +DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_sensors_pm_ops, NULL, cros_ec_sensors_resume);
> EXPORT_SYMBOL_GPL(cros_ec_sensors_pm_ops);

There is a macro that combines DEFINE + EXPORT.

--
With Best Regards,
Andy Shevchenko