diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-08-29 16:43:02 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-09-01 13:52:40 +0200 |
| commit | 7c4a379e0622e7d8e7eb7dbc76445cdd6306aad8 (patch) | |
| tree | 65b4e8bb874871b586e114e962447262cc4a5f41 /include | |
| parent | ALSA: emu10k1: Use guard() for mutex locks (diff) | |
| download | linux-7c4a379e0622e7d8e7eb7dbc76445cdd6306aad8.tar.gz linux-7c4a379e0622e7d8e7eb7dbc76445cdd6306aad8.zip | |
ALSA: emu10k1: Use guard() for emu1010 FPGA locking
The snd_emu1010_fpga_lock() and _unlock() call pairs can be simplified
gracefully with the introduction of guard().
Only code refactoring, and no functional changes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829144342.4290-28-tiwai@suse.de
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/emu10k1.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 38db50b280eb..4f94565c9d15 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h @@ -1842,8 +1842,7 @@ unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data); int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data); int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu, u32 reg, u32 value); -static inline void snd_emu1010_fpga_lock(struct snd_emu10k1 *emu) { mutex_lock(&emu->emu1010.lock); }; -static inline void snd_emu1010_fpga_unlock(struct snd_emu10k1 *emu) { mutex_unlock(&emu->emu1010.lock); }; +DEFINE_GUARD(snd_emu1010_fpga_lock, struct snd_emu10k1 *, mutex_lock(&(_T)->emu1010.lock), mutex_unlock(&(_T)->emu1010.lock)) void snd_emu1010_fpga_write_lock(struct snd_emu10k1 *emu, u32 reg, u32 value); void snd_emu1010_fpga_write(struct snd_emu10k1 *emu, u32 reg, u32 value); void snd_emu1010_fpga_read(struct snd_emu10k1 *emu, u32 reg, u32 *value); |
