Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: als4000: Replace 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.

For building properly, add the dummy functions for
snd_sbmixer_suspend/resume() functions, too.

Just a cleanup, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240207155140.18238-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+5 -7
+3
include/sound/sb.h
··· 290 290 #ifdef CONFIG_PM 291 291 void snd_sbmixer_suspend(struct snd_sb *chip); 292 292 void snd_sbmixer_resume(struct snd_sb *chip); 293 + #else 294 + static inline void snd_sbmixer_suspend(struct snd_sb *chip) {} 295 + static inline void snd_sbmixer_resume(struct snd_sb *chip) {} 293 296 #endif 294 297 295 298 /* sb8_init.c */
+2 -7
sound/pci/als4000.c
··· 936 936 return snd_card_free_on_error(&pci->dev, __snd_card_als4000_probe(pci, pci_id)); 937 937 } 938 938 939 - #ifdef CONFIG_PM_SLEEP 940 939 static int snd_als4000_suspend(struct device *dev) 941 940 { 942 941 struct snd_card *card = dev_get_drvdata(dev); ··· 967 968 return 0; 968 969 } 969 970 970 - static SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume); 971 - #define SND_ALS4000_PM_OPS &snd_als4000_pm 972 - #else 973 - #define SND_ALS4000_PM_OPS NULL 974 - #endif /* CONFIG_PM_SLEEP */ 971 + static DEFINE_SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume); 975 972 976 973 static struct pci_driver als4000_driver = { 977 974 .name = KBUILD_MODNAME, 978 975 .id_table = snd_als4000_ids, 979 976 .probe = snd_card_als4000_probe, 980 977 .driver = { 981 - .pm = SND_ALS4000_PM_OPS, 978 + .pm = &snd_als4000_pm, 982 979 }, 983 980 }; 984 981