Commit 1c69bc39 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240207155140.18238-19-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 9e5f7322
...@@ -486,10 +486,8 @@ struct cmipci { ...@@ -486,10 +486,8 @@ struct cmipci {
spinlock_t reg_lock; spinlock_t reg_lock;
#ifdef CONFIG_PM_SLEEP
unsigned int saved_regs[0x20]; unsigned int saved_regs[0x20];
unsigned char saved_mixers[0x20]; unsigned char saved_mixers[0x20];
#endif
}; };
...@@ -3260,7 +3258,6 @@ static int snd_cmipci_probe(struct pci_dev *pci, ...@@ -3260,7 +3258,6 @@ static int snd_cmipci_probe(struct pci_dev *pci,
return err; return err;
} }
#ifdef CONFIG_PM_SLEEP
/* /*
* power management * power management
*/ */
...@@ -3324,18 +3321,14 @@ static int snd_cmipci_resume(struct device *dev) ...@@ -3324,18 +3321,14 @@ static int snd_cmipci_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume); static DEFINE_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 struct pci_driver cmipci_driver = { static struct pci_driver cmipci_driver = {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
.id_table = snd_cmipci_ids, .id_table = snd_cmipci_ids,
.probe = snd_cmipci_probe, .probe = snd_cmipci_probe,
.driver = { .driver = {
.pm = SND_CMIPCI_PM_OPS, .pm = &snd_cmipci_pm,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment