summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2019-03-05 17:28:44 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 16:29:35 +0800
commit8102eb721161388b2d2d4b49d7e0b6d31a63dfe9 (patch)
tree3880968a33719275f6744a0b5f61669114702c9e /drivers/base
parentc2e74728f9041f2483831a3c2e3d01c191c92b21 (diff)
PM / Domains: Remove the unnecessary ->power_off() check in genpd_power_off
There's already a check in _genpd_power_off, so caller can directly call it without checking. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index cc85e87eaf05..1466f5d7488b 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -497,6 +497,7 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on,
struct pm_domain_data *pdd;
struct gpd_link *link;
unsigned int not_suspended = 0;
+ int ret;
/*
* Do not try to power off the domain in the following situations:
@@ -544,24 +545,20 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on,
if (!genpd->gov)
genpd->state_idx = 0;
- if (genpd->power_off) {
- int ret;
-
- if (atomic_read(&genpd->sd_count) > 0)
- return -EBUSY;
+ if (atomic_read(&genpd->sd_count) > 0)
+ return -EBUSY;
- /*
- * If sd_count > 0 at this point, one of the subdomains hasn't
- * managed to call genpd_power_on() for the master yet after
- * incrementing it. In that case genpd_power_on() will wait
- * for us to drop the lock, so we can call .power_off() and let
- * the genpd_power_on() restore power for us (this shouldn't
- * happen very often).
- */
- ret = _genpd_power_off(genpd, true);
- if (ret)
- return ret;
- }
+ /*
+ * If sd_count > 0 at this point, one of the subdomains hasn't
+ * managed to call genpd_power_on() for the master yet after
+ * incrementing it. In that case genpd_power_on() will wait
+ * for us to drop the lock, so we can call .power_off() and let
+ * the genpd_power_on() restore power for us (this shouldn't
+ * happen very often).
+ */
+ ret = _genpd_power_off(genpd, true);
+ if (ret)
+ return ret;
genpd->status = GPD_STATE_POWER_OFF;
genpd_update_accounting(genpd);