summaryrefslogtreecommitdiff
path: root/drivers/firmware/qcom
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>2026-02-16 10:15:28 +0100
committerBjorn Andersson <andersson@kernel.org>2026-03-18 07:20:21 -0500
commitd98b978446d249df1a662b4fef4c0bbfa1d650b8 (patch)
tree47068feb33d1fe097de927207e614982a9ae4a6b /drivers/firmware/qcom
parent4bfb0ec11e20b9354beabf1b9f3e70e926c407bd (diff)
firmware: qcom: scom: Simplify mutex with guard
Simplify error path unlocking mutex with the guard. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260216091525.107935-6-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'drivers/firmware/qcom')
-rw-r--r--drivers/firmware/qcom/qcom_scm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 5c4375a7fa1f..ca6cedf25677 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -199,19 +199,18 @@ static int qcom_scm_bw_enable(void)
if (!__scm->path)
return 0;
- mutex_lock(&__scm->scm_bw_lock);
+ guard(mutex)(&__scm->scm_bw_lock);
+
if (!__scm->scm_vote_count) {
ret = icc_set_bw(__scm->path, 0, UINT_MAX);
if (ret < 0) {
dev_err(__scm->dev, "failed to set bandwidth request\n");
- goto err_bw;
+ return ret;
}
}
__scm->scm_vote_count++;
-err_bw:
- mutex_unlock(&__scm->scm_bw_lock);
- return ret;
+ return 0;
}
static void qcom_scm_bw_disable(void)