Skip to content

Commit 3f38aa3

Browse files
committed
ALSA: hda: Use RUNTIME_PM_OPS() and pm_ptr()
Clean up the code with the helper macros, and also assure that no PM ops is assigned without CONFIG_PM via pm_ptr(). Merely a cleanup, there should be no actual code change. Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 0d8dfeb commit 3f38aa3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

sound/pci/hda/hda_bind.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name,
185185
drv->core.driver.probe = hda_codec_driver_probe;
186186
drv->core.driver.remove = hda_codec_driver_remove;
187187
drv->core.driver.shutdown = hda_codec_driver_shutdown;
188-
drv->core.driver.pm = &hda_codec_driver_pm;
188+
drv->core.driver.pm = pm_ptr(&hda_codec_driver_pm);
189189
drv->core.type = HDA_DEV_LEGACY;
190190
drv->core.match = hda_codec_match;
191191
drv->core.unsol_event = hda_codec_unsol_event;

sound/pci/hda/hda_codec.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,8 +3037,7 @@ const struct dev_pm_ops hda_codec_driver_pm = {
30373037
.thaw = pm_sleep_ptr(hda_codec_pm_thaw),
30383038
.poweroff = pm_sleep_ptr(hda_codec_pm_suspend),
30393039
.restore = pm_sleep_ptr(hda_codec_pm_restore),
3040-
.runtime_suspend = pm_ptr(hda_codec_runtime_suspend),
3041-
.runtime_resume = pm_ptr(hda_codec_runtime_resume),
3040+
RUNTIME_PM_OPS(hda_codec_runtime_suspend, hda_codec_runtime_resume, NULL)
30423041
};
30433042

30443043
/* suspend the codec at shutdown; called from driver's shutdown callback */

0 commit comments

Comments
 (0)