aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-01-22 14:52:40 +0100
committerTakashi Iwai <tiwai@suse.de>2024-01-28 09:28:12 +0100
commit00a9d3c99188aad14de4a45995c61ba00894c8f6 (patch)
treeabcb8faa2a18f3d9ce6d72ff8fb729b600658395
parentf371dd183ad0b05ad31838a864e7d060ae61009b (diff)
downloadsound-topic/pm-ops.tar.gz
ALSA: doc: Use DEFINE_SIMPLE_DEV_PM_OPS()topic/pm-ops
Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for the example code. This allows us to drop CONFIG_PM_SLEEP ifdefs. While we're at it, expand the driver definition instead of passing directly via .driver.pm field. This seems to be a more common pattern. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--Documentation/sound/kernel-api/writing-an-alsa-driver.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst
index cd421856409e65..2d2998faff62b9 100644
--- a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst
+++ b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst
@@ -3864,14 +3864,16 @@ corresponding destructor.
And next, set suspend/resume callbacks to the pci_driver::
- static SIMPLE_DEV_PM_OPS(snd_my_pm_ops, mychip_suspend, mychip_resume);
+ static DEFINE_SIMPLE_DEV_PM_OPS(snd_my_pm_ops, mychip_suspend, mychip_resume);
static struct pci_driver driver = {
.name = KBUILD_MODNAME,
.id_table = snd_my_ids,
.probe = snd_my_probe,
.remove = snd_my_remove,
- .driver.pm = &snd_my_pm_ops,
+ .driver = {
+ .pm = &snd_my_pm_ops,
+ },
};
Module Parameters