aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <[email protected]>2024-08-23 14:51:06 +0200
committerUlf Hansson <[email protected]>2024-09-13 12:21:04 +0200
commitda64dae42672a03eb877ebf21bde847215f5fa29 (patch)
tree99b35c6aa9042751da1dd6ba16dd5977417ef69f
parent0d946ef4646092a23de2baf7b9d3063fe5571e82 (diff)
pmdomain: rockchip: Simplify locking with guard()
Simplify error handling (smaller error handling) over locks with guard(). Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
-rw-r--r--drivers/pmdomain/rockchip/pm-domains.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
index 5679ad336a11..538dde58d924 100644
--- a/drivers/pmdomain/rockchip/pm-domains.c
+++ b/drivers/pmdomain/rockchip/pm-domains.c
@@ -910,7 +910,7 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
* Prevent any rockchip_pmu_block() from racing with the remainder of
* setup (clocks, register initialization).
*/
- mutex_lock(&dmc_pmu_mutex);
+ guard(mutex)(&dmc_pmu_mutex);
for_each_available_child_of_node_scoped(np, node) {
error = rockchip_pm_add_one_domain(pmu, node);
@@ -943,13 +943,10 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
if (!WARN_ON_ONCE(dmc_pmu))
dmc_pmu = pmu;
- mutex_unlock(&dmc_pmu_mutex);
-
return 0;
err_out:
rockchip_pm_domain_cleanup(pmu);
- mutex_unlock(&dmc_pmu_mutex);
return error;
}