mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 03:35:32 -04:00
ASoC: ti: omap-mcpdm: Use guard() for mutex locks
Clean up the code using guard() for mutex locks. Merely code refactoring, and no behavior change. Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Link: https://patch.msgid.link/20260508103837.138142-5-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -251,13 +251,11 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai);
|
||||
|
||||
mutex_lock(&mcpdm->mutex);
|
||||
guard(mutex)(&mcpdm->mutex);
|
||||
|
||||
if (!snd_soc_dai_active(dai))
|
||||
omap_mcpdm_open_streams(mcpdm);
|
||||
|
||||
mutex_unlock(&mcpdm->mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -269,7 +267,7 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream,
|
||||
int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
|
||||
int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
|
||||
|
||||
mutex_lock(&mcpdm->mutex);
|
||||
guard(mutex)(&mcpdm->mutex);
|
||||
|
||||
if (!snd_soc_dai_active(dai)) {
|
||||
if (omap_mcpdm_active(mcpdm)) {
|
||||
@@ -287,8 +285,6 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream,
|
||||
cpu_latency_qos_remove_request(&mcpdm->pm_qos_req);
|
||||
|
||||
mcpdm->latency[stream1] = 0;
|
||||
|
||||
mutex_unlock(&mcpdm->mutex);
|
||||
}
|
||||
|
||||
static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream,
|
||||
|
||||
Reference in New Issue
Block a user