summaryrefslogtreecommitdiff
path: root/drivers/opp/core.c
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2020-10-29 19:42:29 -0300
committerGitHub <noreply@github.com>2020-10-29 19:42:29 -0300
commit1a578877cf48eb96b5c8554873cdee756ae16c7e (patch)
tree10978aa5e09161d68426acc33554450032ceda65 /drivers/opp/core.c
parent859f1281231fd3c1ca687bb517748daa19eaf402 (diff)
parent8081974b75314b3f52a7afee916c352319261a16 (diff)
Merge pull request #160 from zandrey/5.4-2.1.x-imx
Update 5.4-2.1.x-imx to v5.4.73 from stable
Diffstat (limited to 'drivers/opp/core.c')
-rw-r--r--drivers/opp/core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 29dfaa591f8b..8867bab72e17 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -1796,6 +1796,9 @@ static void _opp_detach_genpd(struct opp_table *opp_table)
{
int index;
+ if (!opp_table->genpd_virt_devs)
+ return;
+
for (index = 0; index < opp_table->required_opp_count; index++) {
if (!opp_table->genpd_virt_devs[index])
continue;
@@ -1842,6 +1845,9 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
if (!opp_table)
return ERR_PTR(-ENOMEM);
+ if (opp_table->genpd_virt_devs)
+ return opp_table;
+
/*
* If the genpd's OPP table isn't already initialized, parsing of the
* required-opps fail for dev. We should retry this after genpd's OPP