All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry
@ 2014-04-29  5:24 Jonghwan Choi
  2014-04-29  5:32 ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Jonghwan Choi @ 2014-04-29  5:24 UTC (permalink / raw)
  To: open list; +Cc: 'Rafael J. Wysocki', 'Len Brown'

Most of the cpufreq table is sorted in descending order.
But when cpufreq table is made from dev_pm_opp_init_cpufreq_table,
it is sorted in ascending order. So in some case to make cpufreq table
with descending order it needs an extra work.

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
 drivers/base/power/opp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 2553867..8d81a46 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -649,7 +649,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 		return -ENOMEM;
 	}
 
-	list_for_each_entry(opp, &dev_opp->opp_list, node) {
+	list_for_each_entry_reverse(opp, &dev_opp->opp_list, node) {
 		if (opp->available) {
 			freq_table[i].driver_data = i;
 			freq_table[i].frequency = opp->rate / 1000;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-29  6:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29  5:24 [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry Jonghwan Choi
2014-04-29  5:32 ` Viresh Kumar
2014-04-29  5:50   ` Jonghwan Choi
2014-04-29  6:10     ` Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.