mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
opp: Fix adding OPP entries in a wrong order if rate is unavailable
Fix adding OPP entries in a wrong (opposite) order if OPP rate is unavailable. The OPP comparison was erroneously skipped, thus OPPs were left unsorted. Tested-by: Peter Geis <[email protected]> Tested-by: Nicolas Chauvet <[email protected]> Tested-by: Matt Merhar <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
This commit is contained in:
1 parent
1048ba83fb
commit
32715be4fe
1 file changed
+4
-6
+4
-6
@@ -1527,12 +1527,10 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
|
||||
mutex_lock(&opp_table->lock);
|
||||
head = &opp_table->opp_list;
|
||||
|
||||
if (likely(!rate_not_available)) {
|
||||
ret = _opp_is_duplicate(dev, new_opp, opp_table, &head);
|
||||
if (ret) {
|
||||
mutex_unlock(&opp_table->lock);
|
||||
return ret;
|
||||
}
|
||||
ret = _opp_is_duplicate(dev, new_opp, opp_table, &head);
|
||||
if (ret) {
|
||||
mutex_unlock(&opp_table->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
list_add(&new_opp->node, head);
|
||||
|
||||
Reference in new issue
Block a user