diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-08-27 09:28:46 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-08-29 11:52:14 +0200 |
| commit | a23160c87986732590e68c1788e9b4929950ef67 (patch) | |
| tree | bf723e8129220e86d1dd18e9a8059dfece628b0a /include | |
| parent | ALSA: hda/common: Use cleanup macros for PM controls (diff) | |
| download | linux-a23160c87986732590e68c1788e9b4929950ef67.tar.gz linux-a23160c87986732590e68c1788e9b4929950ef67.zip | |
ALSA: hda: Use auto cleanup macros for DSP loader locks
There are temporary DSP locking/unlocking patterns found in various
places, and those can be cleaned up nicely with the guard() macro
calling snd_hdac_dsp_lock() and *_unlock().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-7-tiwai@suse.de
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/hdaudio.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h index d38234f8fe44..4e0c1d8af09f 100644 --- a/include/sound/hdaudio.h +++ b/include/sound/hdaudio.h @@ -651,6 +651,7 @@ int snd_hdac_stream_set_lpib(struct hdac_stream *azx_dev, u32 value); #define snd_hdac_dsp_lock(dev) mutex_lock(&(dev)->dsp_mutex) #define snd_hdac_dsp_unlock(dev) mutex_unlock(&(dev)->dsp_mutex) #define snd_hdac_stream_is_locked(dev) ((dev)->locked) +DEFINE_GUARD(snd_hdac_dsp_lock, struct hdac_stream *, snd_hdac_dsp_lock(_T), snd_hdac_dsp_unlock(_T)) /* DSP loader helpers */ int snd_hdac_dsp_prepare(struct hdac_stream *azx_dev, unsigned int format, unsigned int byte_size, struct snd_dma_buffer *bufp); |
