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

ASoC: rt9120: Convert to RUNTIME_PM_OPS()

Use the newer RUNTIME_PM_OPS() macro instead of SET_RUNTIME_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-44-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Takashi Iwai and committed by
Mark Brown
9aaa57d3 957e8cb3

+4 -4
+4 -4
sound/soc/codecs/rt9120.c
··· 590 590 pm_runtime_set_suspended(&i2c->dev); 591 591 } 592 592 593 - static int __maybe_unused rt9120_runtime_suspend(struct device *dev) 593 + static int rt9120_runtime_suspend(struct device *dev) 594 594 { 595 595 struct rt9120_data *data = dev_get_drvdata(dev); 596 596 ··· 603 603 return 0; 604 604 } 605 605 606 - static int __maybe_unused rt9120_runtime_resume(struct device *dev) 606 + static int rt9120_runtime_resume(struct device *dev) 607 607 { 608 608 struct rt9120_data *data = dev_get_drvdata(dev); 609 609 ··· 618 618 } 619 619 620 620 static const struct dev_pm_ops rt9120_pm_ops = { 621 - SET_RUNTIME_PM_OPS(rt9120_runtime_suspend, rt9120_runtime_resume, NULL) 621 + RUNTIME_PM_OPS(rt9120_runtime_suspend, rt9120_runtime_resume, NULL) 622 622 }; 623 623 624 624 static const struct of_device_id __maybe_unused rt9120_device_table[] = { ··· 631 631 .driver = { 632 632 .name = "rt9120", 633 633 .of_match_table = rt9120_device_table, 634 - .pm = &rt9120_pm_ops, 634 + .pm = pm_ptr(&rt9120_pm_ops), 635 635 }, 636 636 .probe = rt9120_probe, 637 637 .remove = rt9120_remove,