From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Elaine Zhang" <zhangqing@rock-chips.com>,
"Adrián Martínez Larumbe" <adrian.larumbe@collabora.com>,
"Boris Brezillon" <boris.brezillon@collabora.com>,
"Chen-Yu Tsai" <wens@csie.org>,
devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
"Sebastian Reichel" <sebastian.reichel@collabora.com>,
kernel@collabora.com
Subject: [PATCH v2 1/6] pmdomain: rockchip: cleanup mutex handling in rockchip_pd_power
Date: Thu, 19 Sep 2024 11:12:42 +0200 [thread overview]
Message-ID: <20240919091834.83572-2-sebastian.reichel@collabora.com> (raw)
In-Reply-To: <20240919091834.83572-1-sebastian.reichel@collabora.com>
Use the cleanup infrastructure to handle the mutex, which
slightly improve code readability for this function.
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Adrian Larumbe <adrian.larumbe@collabora.com> # On Rock 5B
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
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 9b76b62869d0..4f7021f47261 100644
--- a/drivers/pmdomain/rockchip/pm-domains.c
+++ b/drivers/pmdomain/rockchip/pm-domains.c
@@ -529,13 +529,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;
}
@@ -558,7 +557,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.45.2
next prev parent reply other threads:[~2024-09-19 9:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 9:12 [PATCH v2 0/6] Fix RK3588 GPU domain Sebastian Reichel
2024-09-19 9:12 ` Sebastian Reichel [this message]
2024-09-19 9:12 ` [PATCH v2 2/6] pmdomain: rockchip: forward rockchip_do_pmu_set_power_domain errors Sebastian Reichel
2024-09-19 9:12 ` [PATCH v2 3/6] pmdomain: rockchip: reduce indentation in rockchip_pd_power Sebastian Reichel
2024-09-19 9:12 ` [PATCH v2 4/6] dt-bindings: power: rockchip: add regulator support Sebastian Reichel
2024-10-02 14:02 ` Robin Murphy
2024-09-19 9:12 ` [PATCH v2 5/6] pmdomain: " Sebastian Reichel
2024-09-20 23:03 ` Chen-Yu Tsai
2024-09-19 9:12 ` [PATCH v2 6/6] arm64: dts: rockchip: Add GPU power domain regulator dependency for RK3588 Sebastian Reichel
2024-09-19 11:33 ` Jonas Karlman
2024-09-19 19:27 ` Sebastian Reichel
2024-09-19 21:00 ` Jonas Karlman
2024-10-02 10:59 ` [PATCH v2 0/6] Fix RK3588 GPU domain Ulf Hansson
2024-10-02 13:12 ` Chen-Yu Tsai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240919091834.83572-2-sebastian.reichel@collabora.com \
--to=sebastian.reichel@collabora.com \
--cc=adrian.larumbe@collabora.com \
--cc=boris.brezillon@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=kernel@collabora.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=robh@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=wens@csie.org \
--cc=zhangqing@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®