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

ASoC: wm8804: Convert to EXPORT_GPL_DEV_PM_OPS()

Use the newer EXPORT_GPL_DEV_PM_OPS() macro together with pm_ptr(),
which allows us to drop superfluous CONFIG_PM ifdefs.

This optimizes slightly when CONFIG_PM is disabled, too.

Cc: patches@opensource.cirrus.com
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250317095603.20073-53-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Takashi Iwai and committed by
Mark Brown
30200e61 adcb5d32

+4 -7
+1 -1
sound/soc/codecs/wm8804-i2c.c
··· 56 56 static struct i2c_driver wm8804_i2c_driver = { 57 57 .driver = { 58 58 .name = "wm8804", 59 - .pm = &wm8804_pm, 59 + .pm = pm_ptr(&wm8804_pm), 60 60 .of_match_table = of_match_ptr(wm8804_of_match), 61 61 .acpi_match_table = ACPI_PTR(wm8804_acpi_match), 62 62 },
+1 -1
sound/soc/codecs/wm8804-spi.c
··· 38 38 static struct spi_driver wm8804_spi_driver = { 39 39 .driver = { 40 40 .name = "wm8804", 41 - .pm = &wm8804_pm, 41 + .pm = pm_ptr(&wm8804_pm), 42 42 .of_match_table = wm8804_of_match, 43 43 }, 44 44 .probe = wm8804_spi_probe,
+2 -5
sound/soc/codecs/wm8804.c
··· 680 680 } 681 681 EXPORT_SYMBOL_GPL(wm8804_remove); 682 682 683 - #if IS_ENABLED(CONFIG_PM) 684 683 static int wm8804_runtime_resume(struct device *dev) 685 684 { 686 685 struct wm8804_priv *wm8804 = dev_get_drvdata(dev); ··· 712 713 713 714 return 0; 714 715 } 715 - #endif 716 716 717 - const struct dev_pm_ops wm8804_pm = { 718 - SET_RUNTIME_PM_OPS(wm8804_runtime_suspend, wm8804_runtime_resume, NULL) 717 + EXPORT_GPL_DEV_PM_OPS(wm8804_pm) = { 718 + RUNTIME_PM_OPS(wm8804_runtime_suspend, wm8804_runtime_resume, NULL) 719 719 }; 720 - EXPORT_SYMBOL_GPL(wm8804_pm); 721 720 722 721 MODULE_DESCRIPTION("ASoC WM8804 driver"); 723 722 MODULE_AUTHOR("Dimitris Papastamos <dp@opensource.wolfsonmicro.com>");