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

ASoC: rt700-sdw: Convert to RUNTIME_PM_OPS() & co

Use the newer RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() macros
instead of SET_RUNTIME_PM_OPS() and SET_SYSTEM_SLEEP_PM_OPS() together
with pm_ptr(), which allows us dropping ugly __maybe_unused
attributes.

This optimizes slightly when CONFIG_PM is disabled, too.

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

authored by

Takashi Iwai and committed by
Mark Brown
569f7553 ef57148d

+6 -6
+6 -6
sound/soc/codecs/rt700-sdw.c
··· 475 475 }; 476 476 MODULE_DEVICE_TABLE(sdw, rt700_id); 477 477 478 - static int __maybe_unused rt700_dev_suspend(struct device *dev) 478 + static int rt700_dev_suspend(struct device *dev) 479 479 { 480 480 struct rt700_priv *rt700 = dev_get_drvdata(dev); 481 481 ··· 490 490 return 0; 491 491 } 492 492 493 - static int __maybe_unused rt700_dev_system_suspend(struct device *dev) 493 + static int rt700_dev_system_suspend(struct device *dev) 494 494 { 495 495 struct sdw_slave *slave = dev_to_sdw_dev(dev); 496 496 struct rt700_priv *rt700 = dev_get_drvdata(dev); ··· 520 520 521 521 #define RT700_PROBE_TIMEOUT 5000 522 522 523 - static int __maybe_unused rt700_dev_resume(struct device *dev) 523 + static int rt700_dev_resume(struct device *dev) 524 524 { 525 525 struct sdw_slave *slave = dev_to_sdw_dev(dev); 526 526 struct rt700_priv *rt700 = dev_get_drvdata(dev); ··· 551 551 } 552 552 553 553 static const struct dev_pm_ops rt700_pm = { 554 - SET_SYSTEM_SLEEP_PM_OPS(rt700_dev_system_suspend, rt700_dev_resume) 555 - SET_RUNTIME_PM_OPS(rt700_dev_suspend, rt700_dev_resume, NULL) 554 + SYSTEM_SLEEP_PM_OPS(rt700_dev_system_suspend, rt700_dev_resume) 555 + RUNTIME_PM_OPS(rt700_dev_suspend, rt700_dev_resume, NULL) 556 556 }; 557 557 558 558 static struct sdw_driver rt700_sdw_driver = { 559 559 .driver = { 560 560 .name = "rt700", 561 - .pm = &rt700_pm, 561 + .pm = pm_ptr(&rt700_pm), 562 562 }, 563 563 .probe = rt700_sdw_probe, 564 564 .remove = rt700_sdw_remove,