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

ASoC: cs35l33: 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: 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-7-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Takashi Iwai and committed by
Mark Brown
7d1d8f90 5b73cae5

+4 -6
+4 -6
sound/soc/codecs/cs35l33.c
··· 853 853 .use_single_write = true, 854 854 }; 855 855 856 - static int __maybe_unused cs35l33_runtime_resume(struct device *dev) 856 + static int cs35l33_runtime_resume(struct device *dev) 857 857 { 858 858 struct cs35l33_private *cs35l33 = dev_get_drvdata(dev); 859 859 int ret; ··· 891 891 return ret; 892 892 } 893 893 894 - static int __maybe_unused cs35l33_runtime_suspend(struct device *dev) 894 + static int cs35l33_runtime_suspend(struct device *dev) 895 895 { 896 896 struct cs35l33_private *cs35l33 = dev_get_drvdata(dev); 897 897 ··· 909 909 } 910 910 911 911 static const struct dev_pm_ops cs35l33_pm_ops = { 912 - SET_RUNTIME_PM_OPS(cs35l33_runtime_suspend, 913 - cs35l33_runtime_resume, 914 - NULL) 912 + RUNTIME_PM_OPS(cs35l33_runtime_suspend, cs35l33_runtime_resume, NULL) 915 913 }; 916 914 917 915 static int cs35l33_get_hg_data(const struct device_node *np, ··· 1271 1273 static struct i2c_driver cs35l33_i2c_driver = { 1272 1274 .driver = { 1273 1275 .name = "cs35l33", 1274 - .pm = &cs35l33_pm_ops, 1276 + .pm = pm_ptr(&cs35l33_pm_ops), 1275 1277 .of_match_table = cs35l33_of_match, 1276 1278 1277 1279 },