Skip to content

Commit 83b2fba

Browse files
srestorulf
authored andcommitted
pmdomain: rockchip: cleanup mutex handling in rockchip_pd_power
Use the cleanup infrastructure to handle the mutex, which slightly improve code readability for this function. Reviewed-by: Heiko Stuebner <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Tested-by: Adrian Larumbe <[email protected]> # On Rock 5B Signed-off-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/20250220-rk3588-gpu-pwr-domain-regulator-v6-2-a4f9c24e5b81@kernel.org Signed-off-by: Ulf Hansson <[email protected]>
1 parent 53d956d commit 83b2fba

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/pmdomain/rockchip/pm-domains.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,13 +583,12 @@ static int rockchip_pd_power(struct rockchip_pm_domain *pd, bool power_on)
583583
struct rockchip_pmu *pmu = pd->pmu;
584584
int ret;
585585

586-
mutex_lock(&pmu->mutex);
586+
guard(mutex)(&pmu->mutex);
587587

588588
if (rockchip_pmu_domain_is_on(pd) != power_on) {
589589
ret = clk_bulk_enable(pd->num_clks, pd->clks);
590590
if (ret < 0) {
591591
dev_err(pmu->dev, "failed to enable clocks\n");
592-
mutex_unlock(&pmu->mutex);
593592
return ret;
594593
}
595594

@@ -615,7 +614,6 @@ static int rockchip_pd_power(struct rockchip_pm_domain *pd, bool power_on)
615614
clk_bulk_disable(pd->num_clks, pd->clks);
616615
}
617616

618-
mutex_unlock(&pmu->mutex);
619617
return 0;
620618
}
621619

0 commit comments

Comments
 (0)