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

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

authored by

Takashi Iwai and committed by
Mark Brown
1d6128f5 7d1d8f90

+4 -6
+4 -6
sound/soc/codecs/cs35l34.c
··· 1116 1116 cs35l34->core_supplies); 1117 1117 } 1118 1118 1119 - static int __maybe_unused cs35l34_runtime_resume(struct device *dev) 1119 + static int cs35l34_runtime_resume(struct device *dev) 1120 1120 { 1121 1121 struct cs35l34_private *cs35l34 = dev_get_drvdata(dev); 1122 1122 int ret; ··· 1149 1149 return ret; 1150 1150 } 1151 1151 1152 - static int __maybe_unused cs35l34_runtime_suspend(struct device *dev) 1152 + static int cs35l34_runtime_suspend(struct device *dev) 1153 1153 { 1154 1154 struct cs35l34_private *cs35l34 = dev_get_drvdata(dev); 1155 1155 ··· 1165 1165 } 1166 1166 1167 1167 static const struct dev_pm_ops cs35l34_pm_ops = { 1168 - SET_RUNTIME_PM_OPS(cs35l34_runtime_suspend, 1169 - cs35l34_runtime_resume, 1170 - NULL) 1168 + RUNTIME_PM_OPS(cs35l34_runtime_suspend, cs35l34_runtime_resume, NULL) 1171 1169 }; 1172 1170 1173 1171 static const struct of_device_id cs35l34_of_match[] = { ··· 1183 1185 static struct i2c_driver cs35l34_i2c_driver = { 1184 1186 .driver = { 1185 1187 .name = "cs35l34", 1186 - .pm = &cs35l34_pm_ops, 1188 + .pm = pm_ptr(&cs35l34_pm_ops), 1187 1189 .of_match_table = cs35l34_of_match, 1188 1190 1189 1191 },