Commit 6750d6ed authored by Takashi Iwai's avatar Takashi Iwai

ALSA: sis7019: 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 all 4 pages no matter with
CONFIG_PM, 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-28-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ea1741dc
...@@ -90,11 +90,7 @@ struct voice { ...@@ -90,11 +90,7 @@ struct voice {
* we're not doing power management, we still need to allocate a page * we're not doing power management, we still need to allocate a page
* for the silence buffer. * for the silence buffer.
*/ */
#ifdef CONFIG_PM_SLEEP
#define SIS_SUSPEND_PAGES 4 #define SIS_SUSPEND_PAGES 4
#else
#define SIS_SUSPEND_PAGES 1
#endif
struct sis7019 { struct sis7019 {
unsigned long ioport; unsigned long ioport;
...@@ -1152,7 +1148,6 @@ static int sis_chip_init(struct sis7019 *sis) ...@@ -1152,7 +1148,6 @@ static int sis_chip_init(struct sis7019 *sis)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int sis_suspend(struct device *dev) static int sis_suspend(struct device *dev)
{ {
struct snd_card *card = dev_get_drvdata(dev); struct snd_card *card = dev_get_drvdata(dev);
...@@ -1231,11 +1226,7 @@ static int sis_resume(struct device *dev) ...@@ -1231,11 +1226,7 @@ static int sis_resume(struct device *dev)
return -EIO; return -EIO;
} }
static SIMPLE_DEV_PM_OPS(sis_pm, sis_suspend, sis_resume); static DEFINE_SIMPLE_DEV_PM_OPS(sis_pm, sis_suspend, sis_resume);
#define SIS_PM_OPS &sis_pm
#else
#define SIS_PM_OPS NULL
#endif /* CONFIG_PM_SLEEP */
static int sis_alloc_suspend(struct sis7019 *sis) static int sis_alloc_suspend(struct sis7019 *sis)
{ {
...@@ -1397,7 +1388,7 @@ static struct pci_driver sis7019_driver = { ...@@ -1397,7 +1388,7 @@ static struct pci_driver sis7019_driver = {
.id_table = snd_sis7019_ids, .id_table = snd_sis7019_ids,
.probe = snd_sis7019_probe, .probe = snd_sis7019_probe,
.driver = { .driver = {
.pm = SIS_PM_OPS, .pm = &sis_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