On Mon, Jun 15, 2026 at 04:38:14PM +0700, [email protected] wrote: > From: bui duc phuc <[email protected]> > > Clean up the code using guard() for spin locks. > Merely code refactoring, and no behavior change. > > Signed-off-by: bui duc phuc <[email protected]> > ---
Reviewed-by: Frank Li <[email protected]> > sound/soc/fsl/fsl_asrc.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c > index 5fda9b647c70..0b28bcfa47fe 100644 > --- a/sound/soc/fsl/fsl_asrc.c > +++ b/sound/soc/fsl/fsl_asrc.c > @@ -222,10 +222,9 @@ static int fsl_asrc_request_pair(int channels, struct > fsl_asrc_pair *pair) > enum asrc_pair_index index = ASRC_INVALID_PAIR; > struct fsl_asrc *asrc = pair->asrc; > struct device *dev = &asrc->pdev->dev; > - unsigned long lock_flags; > int i, ret = 0; > > - spin_lock_irqsave(&asrc->lock, lock_flags); > + guard(spinlock_irqsave)(&asrc->lock); > > for (i = ASRC_PAIR_A; i < ASRC_PAIR_MAX_NUM; i++) { > if (asrc->pair[i] != NULL) > @@ -250,8 +249,6 @@ static int fsl_asrc_request_pair(int channels, struct > fsl_asrc_pair *pair) > pair->index = index; > } > > - spin_unlock_irqrestore(&asrc->lock, lock_flags); > - > return ret; > } > > @@ -265,19 +262,16 @@ static void fsl_asrc_release_pair(struct fsl_asrc_pair > *pair) > { > struct fsl_asrc *asrc = pair->asrc; > enum asrc_pair_index index = pair->index; > - unsigned long lock_flags; > > /* Make sure the pair is disabled */ > regmap_update_bits(asrc->regmap, REG_ASRCTR, > ASRCTR_ASRCEi_MASK(index), 0); > > - spin_lock_irqsave(&asrc->lock, lock_flags); > + guard(spinlock_irqsave)(&asrc->lock); > > asrc->channel_avail += pair->channels; > asrc->pair[index] = NULL; > pair->error = 0; > - > - spin_unlock_irqrestore(&asrc->lock, lock_flags); > } > > /** > -- > 2.43.0 > >
