Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: chemical: scd4x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

Using these newer macros allows the compiler to remove the unused
structure and functions when !CONFIG_PM_SLEEP + removes the need to
mark pm functions __maybe_unused.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Roan van Dijk <roan@protonic.nl>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220621202719.13644-11-jic23@kernel.org

+4 -4
+4 -4
drivers/iio/chemical/scd4x.c
··· 551 551 }, 552 552 }; 553 553 554 - static int __maybe_unused scd4x_suspend(struct device *dev) 554 + static int scd4x_suspend(struct device *dev) 555 555 { 556 556 struct iio_dev *indio_dev = dev_get_drvdata(dev); 557 557 struct scd4x_state *state = iio_priv(indio_dev); ··· 564 564 return regulator_disable(state->vdd); 565 565 } 566 566 567 - static int __maybe_unused scd4x_resume(struct device *dev) 567 + static int scd4x_resume(struct device *dev) 568 568 { 569 569 struct iio_dev *indio_dev = dev_get_drvdata(dev); 570 570 struct scd4x_state *state = iio_priv(indio_dev); ··· 577 577 return scd4x_send_command(state, CMD_START_MEAS); 578 578 } 579 579 580 - static __maybe_unused SIMPLE_DEV_PM_OPS(scd4x_pm_ops, scd4x_suspend, scd4x_resume); 580 + static DEFINE_SIMPLE_DEV_PM_OPS(scd4x_pm_ops, scd4x_suspend, scd4x_resume); 581 581 582 582 static void scd4x_stop_meas(void *state) 583 583 { ··· 688 688 .driver = { 689 689 .name = KBUILD_MODNAME, 690 690 .of_match_table = scd4x_dt_ids, 691 - .pm = &scd4x_pm_ops 691 + .pm = pm_sleep_ptr(&scd4x_pm_ops), 692 692 }, 693 693 .probe = scd4x_probe, 694 694 };