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

ASoC: cs35l32: 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 superfluous CONFIG_PM
ifdefs.

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

authored by

Takashi Iwai and committed by
Mark Brown
5b73cae5 5ef209dc

+2 -5
+2 -5
sound/soc/codecs/cs35l32.c
··· 504 504 gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); 505 505 } 506 506 507 - #ifdef CONFIG_PM 508 507 static int cs35l32_runtime_suspend(struct device *dev) 509 508 { 510 509 struct cs35l32_private *cs35l32 = dev_get_drvdata(dev); ··· 542 543 543 544 return 0; 544 545 } 545 - #endif 546 546 547 547 static const struct dev_pm_ops cs35l32_runtime_pm = { 548 - SET_RUNTIME_PM_OPS(cs35l32_runtime_suspend, cs35l32_runtime_resume, 549 - NULL) 548 + RUNTIME_PM_OPS(cs35l32_runtime_suspend, cs35l32_runtime_resume, NULL) 550 549 }; 551 550 552 551 static const struct of_device_id cs35l32_of_match[] = { ··· 564 567 static struct i2c_driver cs35l32_i2c_driver = { 565 568 .driver = { 566 569 .name = "cs35l32", 567 - .pm = &cs35l32_runtime_pm, 570 + .pm = pm_ptr(&cs35l32_runtime_pm), 568 571 .of_match_table = cs35l32_of_match, 569 572 }, 570 573 .id_table = cs35l32_id,