Skip to content

Commit da64dae

Browse files
krzkstorulf
authored andcommitted
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]>
1 parent 0d946ef commit da64dae

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/pmdomain/rockchip/pm-domains.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
910910
* Prevent any rockchip_pmu_block() from racing with the remainder of
911911
* setup (clocks, register initialization).
912912
*/
913-
mutex_lock(&dmc_pmu_mutex);
913+
guard(mutex)(&dmc_pmu_mutex);
914914

915915
for_each_available_child_of_node_scoped(np, node) {
916916
error = rockchip_pm_add_one_domain(pmu, node);
@@ -943,13 +943,10 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
943943
if (!WARN_ON_ONCE(dmc_pmu))
944944
dmc_pmu = pmu;
945945

946-
mutex_unlock(&dmc_pmu_mutex);
947-
948946
return 0;
949947

950948
err_out:
951949
rockchip_pm_domain_cleanup(pmu);
952-
mutex_unlock(&dmc_pmu_mutex);
953950
return error;
954951
}
955952

0 commit comments

Comments
 (0)