From: phucduc.bui@gmail.com
To: peter.ujfalusi@gmail.com, broonie@kernel.org
Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
jarkko.nikula@bitmer.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 5/7] ASoC: ti: ams-delta: Use guard() for spin locks
Date: Fri, 8 May 2026 17:38:35 +0700 [thread overview]
Message-ID: <20260508103837.138142-6-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260508103837.138142-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/ti/ams-delta.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/sound/soc/ti/ams-delta.c b/sound/soc/ti/ams-delta.c
index ba173d9fcba9..6dd0d051a757 100644
--- a/sound/soc/ti/ams-delta.c
+++ b/sound/soc/ti/ams-delta.c
@@ -264,10 +264,10 @@ static void cx81801_timeout(struct timer_list *unused)
{
int muted;
- spin_lock(&ams_delta_lock);
- cx81801_cmd_pending = 0;
- muted = ams_delta_muted;
- spin_unlock(&ams_delta_lock);
+ scoped_guard(spinlock, &ams_delta_lock) {
+ cx81801_cmd_pending = 0;
+ muted = ams_delta_muted;
+ }
/* Reconnect the codec DAI back from the modem to the CPU DAI
* only if digital mute still off */
@@ -373,11 +373,11 @@ static void cx81801_receive(struct tty_struct *tty, const u8 *cp, const u8 *fp,
continue;
/* Complete modem response received, apply config to codec */
- spin_lock_bh(&ams_delta_lock);
- mod_timer(&cx81801_timer, jiffies + msecs_to_jiffies(150));
- apply = !ams_delta_muted && !cx81801_cmd_pending;
- cx81801_cmd_pending = 1;
- spin_unlock_bh(&ams_delta_lock);
+ scoped_guard(spinlock_bh, &ams_delta_lock) {
+ mod_timer(&cx81801_timer, jiffies + msecs_to_jiffies(150));
+ apply = !ams_delta_muted && !cx81801_cmd_pending;
+ cx81801_cmd_pending = 1;
+ }
/* Apply config pulse by connecting the codec to the modem
* if not already done */
@@ -426,10 +426,10 @@ static int ams_delta_mute(struct snd_soc_dai *dai, int mute, int direction)
if (ams_delta_muted == mute)
return 0;
- spin_lock_bh(&ams_delta_lock);
- ams_delta_muted = mute;
- apply = !cx81801_cmd_pending;
- spin_unlock_bh(&ams_delta_lock);
+ scoped_guard(spinlock_bh, &ams_delta_lock) {
+ ams_delta_muted = mute;
+ apply = !cx81801_cmd_pending;
+ }
if (apply)
gpiod_set_value(gpiod_modem_codec, !!mute);
--
2.43.0
next prev parent reply other threads:[~2026-05-08 10:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 10:38 [PATCH 0/7] ASoC: ti: Cleanup locking code using guard() helpers phucduc.bui
2026-05-08 10:38 ` [PATCH 1/7] ASoC: ti: j721e-evm: Use guard() for mutex locks phucduc.bui
2026-05-08 10:38 ` [PATCH 2/7] ASoC: ti: omap-dmic: " phucduc.bui
2026-05-08 10:38 ` [PATCH 3/7] ASoC: ti: omap-hdmi: " phucduc.bui
2026-05-08 10:38 ` [PATCH 4/7] ASoC: ti: omap-mcpdm: " phucduc.bui
2026-05-08 10:38 ` phucduc.bui [this message]
2026-05-08 10:38 ` [PATCH 6/7] ASoC: ti: omap-mcbsp-st: Use guard() for spin locks phucduc.bui
2026-05-09 12:26 ` Jarkko Nikula
2026-05-08 10:38 ` [PATCH 7/7] ASoC: ti: omap-mcbsp: Simplify lock and resource handling phucduc.bui
2026-05-10 1:35 ` Mark Brown
2026-05-11 4:44 ` Bui Duc Phuc
2026-05-13 3:14 ` Bui Duc Phuc
2026-05-14 1:35 ` Mark Brown
2026-05-14 10:35 ` Bui Duc Phuc
2026-05-09 12:28 ` [PATCH 0/7] ASoC: ti: Cleanup locking code using guard() helpers Jarkko Nikula
2026-05-11 0:58 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508103837.138142-6-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=broonie@kernel.org \
--cc=jarkko.nikula@bitmer.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@gmail.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.