diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-12-09 00:48:51 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-12-09 20:32:51 -0500 |
commit | 7284a00f17290114d304528fc49aeee5c2b9b433 (patch) | |
tree | e0f9cfe6938907d8cd714abbe16e28563d90cfe7 | |
parent | b4037aaa584bd914bbf578f5ceb2d9884fa7ddb6 (diff) |
PM / OPP: set new_opp->dev_opp to a valid dev_opp
We find/allocate dev_opp after using its value to fill new_opp->dev_opp right
now. Move this to a later point where dev_opp is valid.
Fixes: a7470db6fec4 (PM / OPP don't match for existing OPPs when list is empty)
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/base/power/opp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 2d195f3a1998..c2020520b2bf 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c | |||
@@ -400,7 +400,6 @@ static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq, | |||
400 | mutex_lock(&dev_opp_list_lock); | 400 | mutex_lock(&dev_opp_list_lock); |
401 | 401 | ||
402 | /* populate the opp table */ | 402 | /* populate the opp table */ |
403 | new_opp->dev_opp = dev_opp; | ||
404 | new_opp->rate = freq; | 403 | new_opp->rate = freq; |
405 | new_opp->u_volt = u_volt; | 404 | new_opp->u_volt = u_volt; |
406 | new_opp->available = true; | 405 | new_opp->available = true; |
@@ -460,6 +459,7 @@ static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq, | |||
460 | } | 459 | } |
461 | 460 | ||
462 | list_add: | 461 | list_add: |
462 | new_opp->dev_opp = dev_opp; | ||
463 | list_add_rcu(&new_opp->node, head); | 463 | list_add_rcu(&new_opp->node, head); |
464 | mutex_unlock(&dev_opp_list_lock); | 464 | mutex_unlock(&dev_opp_list_lock); |
465 | 465 | ||