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

ASoC: cs42l83: Convert to SYSTEM_SLEEP_PM_OPS()

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

authored by

Takashi Iwai and committed by
Mark Brown
850910df 92104ed8

+3 -3
+3 -3
sound/soc/codecs/cs42l83-i2c.c
··· 199 199 cs42l42_common_remove(cs42l83); 200 200 } 201 201 202 - static int __maybe_unused cs42l83_i2c_resume(struct device *dev) 202 + static int cs42l83_i2c_resume(struct device *dev) 203 203 { 204 204 int ret; 205 205 ··· 213 213 } 214 214 215 215 static const struct dev_pm_ops cs42l83_i2c_pm_ops = { 216 - SET_SYSTEM_SLEEP_PM_OPS(cs42l42_suspend, cs42l83_i2c_resume) 216 + SYSTEM_SLEEP_PM_OPS(cs42l42_suspend, cs42l83_i2c_resume) 217 217 }; 218 218 219 219 static const struct of_device_id __maybe_unused cs42l83_of_match[] = { ··· 225 225 static struct i2c_driver cs42l83_i2c_driver = { 226 226 .driver = { 227 227 .name = "cs42l83", 228 - .pm = &cs42l83_i2c_pm_ops, 228 + .pm = pm_ptr(&cs42l83_i2c_pm_ops), 229 229 .of_match_table = of_match_ptr(cs42l83_of_match), 230 230 }, 231 231 .probe = cs42l83_i2c_probe,