iio: cros_ec: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Subsystems (2)
PATCH v4 1/1 iio: cros_ec: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). Also replace SIMPLE_DEV_PM_OPS() + EXPORT_SYMBOL_GPL() with EXPORT_GPL_SIMPLE_DEV_PM_OPS().
This allows us to drop the __maybe_unused annotations from the resume callback. This is a straightforward cleanup with no functional change intended.
---
Changes in v2:
- Use EXPORT_GPL_SIMPLE_DEV_PM_OPS for cros_ec_sensors_pm_ops
- Wrap to 75 ish chars for commit messages.
Changes in v3:
- Update commit message based on feedback from v2, and added Reviewed-by tags. Changes in v4:
- Remove the "Reviewed-by" tags.
- Address EXPORT_GPL_SIMPLE_DEV_PM_OPS() usage in cros_ec_sensors_core.c.
---
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 +- drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 5 ++--- drivers/iio/light/cros_ec_light_prox.c | 2 +- drivers/iio/pressure/cros_ec_baro.c | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-)
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c +1 -1
@@ -311,7 +311,7 @@ MODULE_DEVICE_TABLE(platform, cros_ec_sensors_ids);static struct platform_driver cros_ec_sensors_platform_driver = { .driver = { .name ="cros-ec-sensors" , - .pm = &cros_ec_sensors_pm_ops, + .pm =pm_sleep_ptr (&cros_ec_sensors_pm_ops), }, .probe = cros_ec_sensors_probe, .id_table = cros_ec_sensors_ids,
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c +2 -3
@@ -862,7 +862,7 @@ int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st, }EXPORT_SYMBOL_GPL (cros_ec_sensors_core_write); -static int __maybe_unused cros_ec_sensors_resume (struct device *dev) +static int cros_ec_sensors_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct cros_ec_sensors_core_state *st =iio_priv (indio_dev);
@@ -879,8 +879,7 @@ static int __maybe_unused cros_ec_sensors_resume(struct device *dev)return ret; } -SIMPLE_DEV_PM_OPS (cros_ec_sensors_pm_ops,NULL , cros_ec_sensors_resume); -EXPORT_SYMBOL_GPL (cros_ec_sensors_pm_ops); +EXPORT_GPL_SIMPLE_DEV_PM_OPS (cros_ec_sensors_pm_ops,NULL , cros_ec_sensors_resume);MODULE_DESCRIPTION ("ChromeOS EC sensor hub core functions" );MODULE_LICENSE ("GPL v2" );
drivers/iio/light/cros_ec_light_prox.c +1 -1
@@ -249,7 +249,7 @@ MODULE_DEVICE_TABLE(platform, cros_ec_light_prox_ids);static struct platform_driver cros_ec_light_prox_platform_driver = { .driver = { .name ="cros-ec-light-prox" , - .pm = &cros_ec_sensors_pm_ops, + .pm =pm_sleep_ptr (&cros_ec_sensors_pm_ops), }, .probe = cros_ec_light_prox_probe, .id_table = cros_ec_light_prox_ids,
drivers/iio/pressure/cros_ec_baro.c +1 -1
@@ -192,7 +192,7 @@ MODULE_DEVICE_TABLE(platform, cros_ec_baro_ids);static struct platform_driver cros_ec_baro_platform_driver = { .driver = { .name ="cros-ec-baro" , - .pm = &cros_ec_sensors_pm_ops, + .pm =pm_sleep_ptr (&cros_ec_sensors_pm_ops), }, .probe = cros_ec_baro_probe, .id_table = cros_ec_baro_ids,
Signature · 1 line
2.53.0
Quoted 8 lines · Triet Hoang
Convert deprecated
SIMPLE_DEV_PM_OPS()toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr(). Also replaceSIMPLE_DEV_PM_OPS()+EXPORT_SYMBOL_GPL()withEXPORT_GPL_SIMPLE_DEV_PM_OPS().This allows us to drop the
__maybe_unusedannotations from the resume callback. This is a straightforward cleanup with no functional change intended.Signed-off-by Triet Hoang <[email protected]>
Quoted 11 lines · On Fri, 28 Aug 2026 05:36:00 +0000 Tzung-Bi Shih <[email protected]> wrote:
Quoted 8 lines · Triet Hoang
Convert deprecated
SIMPLE_DEV_PM_OPS()toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr(). Also replaceSIMPLE_DEV_PM_OPS()+EXPORT_SYMBOL_GPL()withEXPORT_GPL_SIMPLE_DEV_PM_OPS().This allows us to drop the
__maybe_unusedannotations from the resume callback. This is a straightforward cleanup with no functional change intended.Signed-off-by Triet Hoang <[email protected]>Reviewed-by Tzung-Bi Shih <[email protected]>
Applied.
Thanks
Jonathan
Quoted 6 lines · Triet Hoang
Convert deprecated
SIMPLE_DEV_PM_OPS()toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr(). Also replaceSIMPLE_DEV_PM_OPS()+EXPORT_SYMBOL_GPL()withEXPORT_GPL_SIMPLE_DEV_PM_OPS().This allows us to drop the
__maybe_unusedannotations from the resume callback. This is a straightforward cleanup with no functional change intended.
LGTM now,
Signature · 2 lines
With Best Regards, Andy Shevchenko