diff options
| author | Ulf Hansson <ulf.hansson@linaro.org> | 2025-04-17 16:25:00 +0200 |
|---|---|---|
| committer | Ulf Hansson <ulf.hansson@linaro.org> | 2025-05-02 12:34:01 +0200 |
| commit | f34a06762799e35047cad47a5db86a28174a4c4d (patch) | |
| tree | 19052d4258ce12d5f7498b4ccb8b750ec54eb5a2 | |
| parent | 0e3b66725eaa51e8e5a20a582bf6338f131913d6 (diff) | |
pmdomain: core: Simplify return statement in genpd_power_off()
Rather than using two if-clauses immediately after each to check for
similar reasons to prevent the power-off, let's combine them into one
if-clause to simplify the code.
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20250417142513.312939-3-ulf.hansson@linaro.org
| -rw-r--r-- | drivers/pmdomain/core.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 436630bf7d7f..25aa229374c0 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -917,20 +917,14 @@ static void genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on, /* * Do not try to power off the domain in the following situations: - * (1) The domain is already in the "power off" state. - * (2) System suspend is in progress. + * The domain is already in the "power off" state. + * System suspend is in progress. + * The domain is configured as always on. + * The domain has a subdomain being powered on. */ - if (!genpd_status_on(genpd) || genpd->prepared_count > 0) - return; - - /* - * Abort power off for the PM domain in the following situations: - * (1) The domain is configured as always on. - * (2) When the domain has a subdomain being powered on. - */ - if (genpd_is_always_on(genpd) || - genpd_is_rpm_always_on(genpd) || - atomic_read(&genpd->sd_count) > 0) + if (!genpd_status_on(genpd) || genpd->prepared_count > 0 || + genpd_is_always_on(genpd) || genpd_is_rpm_always_on(genpd) || + atomic_read(&genpd->sd_count) > 0) return; /* |
