From: phucduc.bui@gmail.com
To: Srinivas Kandagatla <srini@kernel.org>, Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 3/9] ASoc: qcom: q6afe: Use guard() for mutex locks
Date: Wed, 3 Jun 2026 18:49:43 +0700 [thread overview]
Message-ID: <20260603114949.149595-4-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260603114949.149595-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
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>
---
NOTE: This patch is compile-tested only.
sound/soc/qcom/qdsp6/q6afe.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
index 40237267fda0..81a93b6f7e4c 100644
--- a/sound/soc/qcom/qdsp6/q6afe.c
+++ b/sound/soc/qcom/qdsp6/q6afe.c
@@ -1035,7 +1035,7 @@ static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
struct aprv2_ibasic_rsp_result_t *result;
int ret;
- mutex_lock(&afe->lock);
+ guard(mutex)(&afe->lock);
if (port) {
wait = &port->wait;
result = &port->result;
@@ -1050,8 +1050,7 @@ static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
ret = apr_send_pkt(afe->apr, pkt);
if (ret < 0) {
dev_err(afe->dev, "packet not transmitted (%d)\n", ret);
- ret = -EINVAL;
- goto err;
+ return -EINVAL;
}
ret = wait_event_timeout(*wait, (result->opcode == rsp_opcode),
@@ -1066,9 +1065,6 @@ static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
ret = 0;
}
-err:
- mutex_unlock(&afe->lock);
-
return ret;
}
--
2.43.0
next prev parent reply other threads:[~2026-06-03 11:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 11:49 [PATCH 0/9] ASoC: qcom: Use guard() for mutex & spin locks phucduc.bui
2026-06-03 11:49 ` [PATCH 1/9] ASoC: qcom: audioreach: Use guard() for mutex locks phucduc.bui
2026-06-03 11:49 ` [PATCH 2/9] ASoc: qcom: q6adm: Use guard() for mutex & spin locks phucduc.bui
2026-06-03 11:49 ` phucduc.bui [this message]
2026-06-03 11:49 ` [PATCH 4/9] ASoC: qcom: q6apm: Use guard() for mutex locks phucduc.bui
2026-06-03 11:49 ` [PATCH 5/9] ASoC: qcom: q6asm: Use guard() for mutex & spin locks phucduc.bui
2026-06-03 11:49 ` [PATCH 6/9] ASoC: qdsp6: q6core: Use guard() for mutex locks phucduc.bui
2026-06-03 11:49 ` [PATCH 7/9] ASoC: qdsp6: q6routing: " phucduc.bui
2026-06-03 11:49 ` [PATCH 8/9] ASoC: qdsp6: q6usb: " phucduc.bui
2026-06-03 11:49 ` [PATCH 9/9] ASoC: qcom: topology: " phucduc.bui
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=20260603114949.149595-4-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=broonie@kernel.org \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=srini@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox