mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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>
This commit is contained in:
committed by
Bjorn Andersson
parent
4bfb0ec11e
commit
d98b978446
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user