Skip to content

Commit da64dae

Browse files
krzkUlf Hansson
authored andcommitted
pmdomain: rockchip: Simplify locking with guard()
Simplify error handling (smaller error handling) over locks with guard(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20240823-cleanup-h-guard-pm-domain-v1-2-8320722eaf39@linaro.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 0d946ef commit da64dae

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

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)