-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0045-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch
46 lines (37 loc) · 1.48 KB
/
0045-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From e3c8bdc42cbe5decfc05d86b1874857ff3f885f4 Mon Sep 17 00:00:00 2001
From: Sebastian Reichel <[email protected]>
Date: Fri, 6 Sep 2024 17:03:53 +0200
Subject: [PATCH 45/77] 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: Adrian Larumbe <[email protected]> # On Rock 5B
Signed-off-by: Sebastian Reichel <[email protected]>
---
drivers/pmdomain/rockchip/pm-domains.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
index cb0f938001382..a161ee13c6336 100644
--- a/drivers/pmdomain/rockchip/pm-domains.c
+++ b/drivers/pmdomain/rockchip/pm-domains.c
@@ -574,13 +574,12 @@ static int rockchip_pd_power(struct rockchip_pm_domain *pd, bool power_on)
struct rockchip_pmu *pmu = pd->pmu;
int ret;
- mutex_lock(&pmu->mutex);
+ guard(mutex)(&pmu->mutex);
if (rockchip_pmu_domain_is_on(pd) != power_on) {
ret = clk_bulk_enable(pd->num_clks, pd->clks);
if (ret < 0) {
dev_err(pmu->dev, "failed to enable clocks\n");
- mutex_unlock(&pmu->mutex);
return ret;
}
@@ -606,7 +605,6 @@ static int rockchip_pd_power(struct rockchip_pm_domain *pd, bool power_on)
clk_bulk_disable(pd->num_clks, pd->clks);
}
- mutex_unlock(&pmu->mutex);
return 0;
}
--
2.47.0