Skip to content

Commit 7d08366

Browse files
morimotobroonie
authored andcommitted
ASoC: renesas: rz-ssi: Use guard() for spin locks
Clean up the code using guard() for spin locks. Merely code refactoring, and no behavior change. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Message-ID: <87frcx1yp5.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 15583c4 commit 7d08366

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

sound/soc/renesas/rz-ssi.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,24 +188,18 @@ static void rz_ssi_set_substream(struct rz_ssi_stream *strm,
188188
struct snd_pcm_substream *substream)
189189
{
190190
struct rz_ssi_priv *ssi = strm->priv;
191-
unsigned long flags;
192191

193-
spin_lock_irqsave(&ssi->lock, flags);
192+
guard(spinlock_irqsave)(&ssi->lock);
193+
194194
strm->substream = substream;
195-
spin_unlock_irqrestore(&ssi->lock, flags);
196195
}
197196

198197
static bool rz_ssi_stream_is_valid(struct rz_ssi_priv *ssi,
199198
struct rz_ssi_stream *strm)
200199
{
201-
unsigned long flags;
202-
bool ret;
203-
204-
spin_lock_irqsave(&ssi->lock, flags);
205-
ret = strm->substream && strm->substream->runtime;
206-
spin_unlock_irqrestore(&ssi->lock, flags);
200+
guard(spinlock_irqsave)(&ssi->lock);
207201

208-
return ret;
202+
return strm->substream && strm->substream->runtime;
209203
}
210204

211205
static inline bool rz_ssi_is_stream_running(struct rz_ssi_stream *strm)

0 commit comments

Comments
 (0)