aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-02-07 16:51:29 +0100
committerTakashi Iwai <tiwai@suse.de>2024-02-12 11:50:25 +0100
commit1c69bc3955aae7cc0c7eff673122d048bc8bc571 (patch)
tree88a099839ef440fcfd086f75b3f51c4ba9e7fed9 /sound/pci
parent9e5f7322773169f3fcdc841b4c1ae5e19afe4ef6 (diff)
downloadlinux-1c69bc3955aae7cc0c7eff673122d048bc8bc571.tar.gz
ALSA: cmipci: Simplify with DEFINE_SIMPLE_DEV_PM_OPS()
Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. This ends up with the allocation of a few additional bytes for the register dumps even if it's not really used, but the code simplification should justify the cost. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240207155140.18238-19-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/cmipci.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 08e34b1847801..36014501f7ed2 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -486,10 +486,8 @@ struct cmipci {
spinlock_t reg_lock;
-#ifdef CONFIG_PM_SLEEP
unsigned int saved_regs[0x20];
unsigned char saved_mixers[0x20];
-#endif
};
@@ -3260,7 +3258,6 @@ static int snd_cmipci_probe(struct pci_dev *pci,
return err;
}
-#ifdef CONFIG_PM_SLEEP
/*
* power management
*/
@@ -3324,18 +3321,14 @@ static int snd_cmipci_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume);
-#define SND_CMIPCI_PM_OPS &snd_cmipci_pm
-#else
-#define SND_CMIPCI_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
+static DEFINE_SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume);
static struct pci_driver cmipci_driver = {
.name = KBUILD_MODNAME,
.id_table = snd_cmipci_ids,
.probe = snd_cmipci_probe,
.driver = {
- .pm = SND_CMIPCI_PM_OPS,
+ .pm = &snd_cmipci_pm,
},
};