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

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

authored by

Takashi Iwai and committed by
Mark Brown
adcb5d32 208a479d

+2 -5
+2 -5
sound/soc/codecs/wm5100.c
··· 2625 2625 gpiod_set_value_cansleep(wm5100->ldo_ena, 0); 2626 2626 } 2627 2627 2628 - #ifdef CONFIG_PM 2629 2628 static int wm5100_runtime_suspend(struct device *dev) 2630 2629 { 2631 2630 struct wm5100_priv *wm5100 = dev_get_drvdata(dev); ··· 2661 2662 2662 2663 return 0; 2663 2664 } 2664 - #endif 2665 2665 2666 2666 static const struct dev_pm_ops wm5100_pm = { 2667 - SET_RUNTIME_PM_OPS(wm5100_runtime_suspend, wm5100_runtime_resume, 2668 - NULL) 2667 + RUNTIME_PM_OPS(wm5100_runtime_suspend, wm5100_runtime_resume, NULL) 2669 2668 }; 2670 2669 2671 2670 static const struct i2c_device_id wm5100_i2c_id[] = { ··· 2675 2678 static struct i2c_driver wm5100_i2c_driver = { 2676 2679 .driver = { 2677 2680 .name = "wm5100", 2678 - .pm = &wm5100_pm, 2681 + .pm = pm_ptr(&wm5100_pm), 2679 2682 }, 2680 2683 .probe = wm5100_i2c_probe, 2681 2684 .remove = wm5100_i2c_remove,