Skip to content

Commit d98b978

Browse files
krzkandersson
authored andcommitted
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>
1 parent 4bfb0ec commit d98b978

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/firmware/qcom/qcom_scm.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,18 @@ static int qcom_scm_bw_enable(void)
199199
if (!__scm->path)
200200
return 0;
201201

202-
mutex_lock(&__scm->scm_bw_lock);
202+
guard(mutex)(&__scm->scm_bw_lock);
203+
203204
if (!__scm->scm_vote_count) {
204205
ret = icc_set_bw(__scm->path, 0, UINT_MAX);
205206
if (ret < 0) {
206207
dev_err(__scm->dev, "failed to set bandwidth request\n");
207-
goto err_bw;
208+
return ret;
208209
}
209210
}
210211
__scm->scm_vote_count++;
211-
err_bw:
212-
mutex_unlock(&__scm->scm_bw_lock);
213212

214-
return ret;
213+
return 0;
215214
}
216215

217216
static void qcom_scm_bw_disable(void)

0 commit comments

Comments
 (0)