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

iio: adc: ti-am335x: 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: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220621202719.13644-9-jic23@kernel.org

+4 -4
+4 -4
drivers/iio/adc/ti_am335x_adc.c
··· 702 702 return 0; 703 703 } 704 704 705 - static int __maybe_unused tiadc_suspend(struct device *dev) 705 + static int tiadc_suspend(struct device *dev) 706 706 { 707 707 struct iio_dev *indio_dev = dev_get_drvdata(dev); 708 708 struct tiadc_device *adc_dev = iio_priv(indio_dev); ··· 715 715 return 0; 716 716 } 717 717 718 - static int __maybe_unused tiadc_resume(struct device *dev) 718 + static int tiadc_resume(struct device *dev) 719 719 { 720 720 struct iio_dev *indio_dev = dev_get_drvdata(dev); 721 721 struct tiadc_device *adc_dev = iio_priv(indio_dev); ··· 732 732 return 0; 733 733 } 734 734 735 - static SIMPLE_DEV_PM_OPS(tiadc_pm_ops, tiadc_suspend, tiadc_resume); 735 + static DEFINE_SIMPLE_DEV_PM_OPS(tiadc_pm_ops, tiadc_suspend, tiadc_resume); 736 736 737 737 static const struct of_device_id ti_adc_dt_ids[] = { 738 738 { .compatible = "ti,am3359-adc", }, ··· 744 744 static struct platform_driver tiadc_driver = { 745 745 .driver = { 746 746 .name = "TI-am335x-adc", 747 - .pm = &tiadc_pm_ops, 747 + .pm = pm_sleep_ptr(&tiadc_pm_ops), 748 748 .of_match_table = ti_adc_dt_ids, 749 749 }, 750 750 .probe = tiadc_probe,