aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorStratos Karafotis <stratosk@semaphore.gr>2014-04-25 16:16:11 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-04-29 18:06:34 -0400
commitfdb56c45a2cadd11b27447f9468c712b59e15b33 (patch)
tree6cf8f6a9e96dbef88bbb7a7cb4b40693dbb75581 /drivers/mfd
parent499f8ad5ab8a3bd79e31d80469e509a5bcd86aa3 (diff)
mfd: db8500-prcmu: Use cpufreq_for_each_entry macro for iteration
The cpufreq core now supports the cpufreq_for_each_entry macro helper for iteration over the cpufreq_frequency_table, so use it. It should have no functional changes. Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/db8500-prcmu.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 7694e0700d34..b11fdd63eecd 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -1734,18 +1734,17 @@ static struct cpufreq_frequency_table db8500_cpufreq_table[] = {
1734 1734
1735static long round_armss_rate(unsigned long rate) 1735static long round_armss_rate(unsigned long rate)
1736{ 1736{
1737 struct cpufreq_frequency_table *pos;
1737 long freq = 0; 1738 long freq = 0;
1738 int i = 0;
1739 1739
1740 /* cpufreq table frequencies is in KHz. */ 1740 /* cpufreq table frequencies is in KHz. */
1741 rate = rate / 1000; 1741 rate = rate / 1000;
1742 1742
1743 /* Find the corresponding arm opp from the cpufreq table. */ 1743 /* Find the corresponding arm opp from the cpufreq table. */
1744 while (db8500_cpufreq_table[i].frequency != CPUFREQ_TABLE_END) { 1744 cpufreq_for_each_entry(pos, db8500_cpufreq_table) {
1745 freq = db8500_cpufreq_table[i].frequency; 1745 freq = pos->frequency;
1746 if (freq == rate) 1746 if (freq == rate)
1747 break; 1747 break;
1748 i++;
1749 } 1748 }
1750 1749
1751 /* Return the last valid value, even if a match was not found. */ 1750 /* Return the last valid value, even if a match was not found. */
@@ -1886,23 +1885,21 @@ static void set_clock_rate(u8 clock, unsigned long rate)
1886 1885
1887static int set_armss_rate(unsigned long rate) 1886static int set_armss_rate(unsigned long rate)
1888{ 1887{
1889 int i = 0; 1888 struct cpufreq_frequency_table *pos;
1890 1889
1891 /* cpufreq table frequencies is in KHz. */ 1890 /* cpufreq table frequencies is in KHz. */
1892 rate = rate / 1000; 1891 rate = rate / 1000;
1893 1892
1894 /* Find the corresponding arm opp from the cpufreq table. */ 1893 /* Find the corresponding arm opp from the cpufreq table. */
1895 while (db8500_cpufreq_table[i].frequency != CPUFREQ_TABLE_END) { 1894 cpufreq_for_each_entry(pos, db8500_cpufreq_table)
1896 if (db8500_cpufreq_table[i].frequency == rate) 1895 if (pos->frequency == rate)
1897 break; 1896 break;
1898 i++;
1899 }
1900 1897
1901 if (db8500_cpufreq_table[i].frequency != rate) 1898 if (pos->frequency != rate)
1902 return -EINVAL; 1899 return -EINVAL;
1903 1900
1904 /* Set the new arm opp. */ 1901 /* Set the new arm opp. */
1905 return db8500_prcmu_set_arm_opp(db8500_cpufreq_table[i].driver_data); 1902 return db8500_prcmu_set_arm_opp(pos->driver_data);
1906} 1903}
1907 1904
1908static int set_plldsi_rate(unsigned long rate) 1905static int set_plldsi_rate(unsigned long rate)