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

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

authored by

Takashi Iwai and committed by
Mark Brown
fdf698fa 3eedadf3

+7 -7
+4 -4
sound/soc/codecs/rt5514-spi.c
··· 458 458 return 0; 459 459 } 460 460 461 - static int __maybe_unused rt5514_suspend(struct device *dev) 461 + static int rt5514_suspend(struct device *dev) 462 462 { 463 463 int irq = to_spi_device(dev)->irq; 464 464 ··· 468 468 return 0; 469 469 } 470 470 471 - static int __maybe_unused rt5514_resume(struct device *dev) 471 + static int rt5514_resume(struct device *dev) 472 472 { 473 473 struct rt5514_dsp *rt5514_dsp = dev_get_drvdata(dev); 474 474 int irq = to_spi_device(dev)->irq; ··· 490 490 } 491 491 492 492 static const struct dev_pm_ops rt5514_pm_ops = { 493 - SET_SYSTEM_SLEEP_PM_OPS(rt5514_suspend, rt5514_resume) 493 + SYSTEM_SLEEP_PM_OPS(rt5514_suspend, rt5514_resume) 494 494 }; 495 495 496 496 static const struct of_device_id rt5514_of_match[] = { ··· 502 502 static struct spi_driver rt5514_spi_driver = { 503 503 .driver = { 504 504 .name = "rt5514", 505 - .pm = &rt5514_pm_ops, 505 + .pm = pm_ptr(&rt5514_pm_ops), 506 506 .of_match_table = of_match_ptr(rt5514_of_match), 507 507 }, 508 508 .probe = rt5514_spi_probe,
+3 -3
sound/soc/codecs/rt5514.c
··· 1231 1231 return 0; 1232 1232 } 1233 1233 1234 - static __maybe_unused int rt5514_i2c_resume(struct device *dev) 1234 + static int rt5514_i2c_resume(struct device *dev) 1235 1235 { 1236 1236 struct rt5514_priv *rt5514 = dev_get_drvdata(dev); 1237 1237 unsigned int val; ··· 1313 1313 } 1314 1314 1315 1315 static const struct dev_pm_ops rt5514_i2_pm_ops = { 1316 - SET_SYSTEM_SLEEP_PM_OPS(NULL, rt5514_i2c_resume) 1316 + SYSTEM_SLEEP_PM_OPS(NULL, rt5514_i2c_resume) 1317 1317 }; 1318 1318 1319 1319 static struct i2c_driver rt5514_i2c_driver = { ··· 1321 1321 .name = "rt5514", 1322 1322 .acpi_match_table = ACPI_PTR(rt5514_acpi_match), 1323 1323 .of_match_table = of_match_ptr(rt5514_of_match), 1324 - .pm = &rt5514_i2_pm_ops, 1324 + .pm = pm_ptr(&rt5514_i2_pm_ops), 1325 1325 }, 1326 1326 .probe = rt5514_i2c_probe, 1327 1327 .id_table = rt5514_i2c_id,