Subject: Re: [PATCH 2/4] ASoC: stm: stm32_i2s: Use guard() for spin locks

From: Mark Brown <[email-masked]>
Date: Thu, 14 May 2026 10:25:48 +0900

On Wed, May 13, 2026 at 05:43:27PM +0700, [email-masked] wrote:

> @@ -1016,21 +1014,18 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
>  					   I2S_IER_OVRIE,
>  					   (unsigned int)~I2S_IER_OVRIE);
>  
> -		spin_lock(&i2s->lock_fd);
> -		i2s->refcount--;
> -		if (i2s->refcount) {
> -			spin_unlock(&i2s->lock_fd);
> -			break;
> -		}
> +		scoped_guard(spinlock, &i2s->lock_fd) {
> +			i2s->refcount--;
> +			if (i2s->refcount)
> +				break;

How does scoped_guard interact with break statements - does this still
apply to the switch?  I've not looked at how they're implemented...