diff options
author | Takashi Iwai <tiwai@suse.de> | 2024-02-07 18:51:27 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2024-02-12 13:50:25 +0300 |
commit | 00545e3eb74a1892a13670cb03089a701b782b30 (patch) | |
tree | 6ac567a31691e2ccd4c669b881eb8e9a1ebffeee | |
parent | b9beb229eb265c544314a4e834d8467943c89650 (diff) | |
download | linux-00545e3eb74a1892a13670cb03089a701b782b30.tar.xz |
ALSA: ali5451: 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
image 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-17-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/ali5451/ali5451.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 9d48638a3ab4..31e51e2df655 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -243,9 +243,7 @@ struct snd_ali { spinlock_t reg_lock; spinlock_t voice_alloc; -#ifdef CONFIG_PM_SLEEP struct snd_ali_image image; -#endif }; static const struct pci_device_id snd_ali_ids[] = { @@ -1824,7 +1822,6 @@ static int snd_ali_mixer(struct snd_ali *codec) return 0; } -#ifdef CONFIG_PM_SLEEP static int ali_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); @@ -1900,11 +1897,7 @@ static int ali_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume); -#define ALI_PM_OPS &ali_pm -#else -#define ALI_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume); static void snd_ali_free(struct snd_card *card) { @@ -2166,7 +2159,7 @@ static struct pci_driver ali5451_driver = { .id_table = snd_ali_ids, .probe = snd_ali_probe, .driver = { - .pm = ALI_PM_OPS, + .pm = &ali_pm, }, }; |