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

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

authored by

Takashi Iwai and committed by
Mark Brown
71ba303a fdf698fa

+4 -4
+4 -4
sound/soc/codecs/rt5645.c
··· 4314 4314 gpiod_set_value(rt5645->gpiod_cbj_sleeve, 0); 4315 4315 } 4316 4316 4317 - static int __maybe_unused rt5645_sys_suspend(struct device *dev) 4317 + static int rt5645_sys_suspend(struct device *dev) 4318 4318 { 4319 4319 struct rt5645_priv *rt5645 = dev_get_drvdata(dev); 4320 4320 ··· 4327 4327 return 0; 4328 4328 } 4329 4329 4330 - static int __maybe_unused rt5645_sys_resume(struct device *dev) 4330 + static int rt5645_sys_resume(struct device *dev) 4331 4331 { 4332 4332 struct rt5645_priv *rt5645 = dev_get_drvdata(dev); 4333 4333 ··· 4342 4342 } 4343 4343 4344 4344 static const struct dev_pm_ops rt5645_pm = { 4345 - SET_SYSTEM_SLEEP_PM_OPS(rt5645_sys_suspend, rt5645_sys_resume) 4345 + SYSTEM_SLEEP_PM_OPS(rt5645_sys_suspend, rt5645_sys_resume) 4346 4346 }; 4347 4347 4348 4348 static struct i2c_driver rt5645_i2c_driver = { ··· 4350 4350 .name = "rt5645", 4351 4351 .of_match_table = of_match_ptr(rt5645_of_match), 4352 4352 .acpi_match_table = ACPI_PTR(rt5645_acpi_match), 4353 - .pm = &rt5645_pm, 4353 + .pm = pm_ptr(&rt5645_pm), 4354 4354 }, 4355 4355 .probe = rt5645_i2c_probe, 4356 4356 .remove = rt5645_i2c_remove,