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

ALSA: ens137x: 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_ak4531_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-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+5 -7
+3
include/sound/ak4531_codec.h
··· 65 65 #ifdef CONFIG_PM 66 66 void snd_ak4531_suspend(struct snd_ak4531 *ak4531); 67 67 void snd_ak4531_resume(struct snd_ak4531 *ak4531); 68 + #else 69 + static inline void snd_ak4531_suspend(struct snd_ak4531 *ak4531) {} 70 + static inline void snd_ak4531_resume(struct snd_ak4531 *ak4531) {} 68 71 #endif 69 72 70 73 #endif /* __SOUND_AK4531_CODEC_H */
+2 -7
sound/pci/ens1370.c
··· 1968 1968 outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); 1969 1969 } 1970 1970 1971 - #ifdef CONFIG_PM_SLEEP 1972 1971 static int snd_ensoniq_suspend(struct device *dev) 1973 1972 { 1974 1973 struct snd_card *card = dev_get_drvdata(dev); ··· 2006 2007 return 0; 2007 2008 } 2008 2009 2009 - static SIMPLE_DEV_PM_OPS(snd_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume); 2010 - #define SND_ENSONIQ_PM_OPS &snd_ensoniq_pm 2011 - #else 2012 - #define SND_ENSONIQ_PM_OPS NULL 2013 - #endif /* CONFIG_PM_SLEEP */ 2010 + static DEFINE_SIMPLE_DEV_PM_OPS(snd_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume); 2014 2011 2015 2012 static int snd_ensoniq_create(struct snd_card *card, 2016 2013 struct pci_dev *pci) ··· 2375 2380 .id_table = snd_audiopci_ids, 2376 2381 .probe = snd_audiopci_probe, 2377 2382 .driver = { 2378 - .pm = SND_ENSONIQ_PM_OPS, 2383 + .pm = &snd_ensoniq_pm, 2379 2384 }, 2380 2385 }; 2381 2386