On 02-03-18, 14:43, Jordan Crouse wrote:
+static int a6xx_gmu_build_freq_table(struct device *dev, unsigned long *freqs,
u32 size)
+{
- int count = dev_pm_opp_get_opp_count(dev);
- struct dev_pm_opp *opp;
- int i, index = 0;
- unsigned long freq = 1;
- /*
* The OPP table doesn't contain the "off" frequency level so we need to
* add 1 to the table size to account for it
*/
- if (WARN(count + 1 > size,
"The GMU frequency table is being truncated\n"))
count = size - 1;
- /* Set the "off" frequency */
- freqs[index++] = 0;
- for (i = 0; i < count; i++) {
opp = dev_pm_opp_find_freq_ceil(dev, &freq);
if (IS_ERR(opp))
break;
freqs[index++] = freq++;
dev_pm_opp_put(opp) ?
- }
- return index;
+}