Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5404b19c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "PM / devfreq: Use freq_table for available_frequencies"

parents 27dee30d 6d2cd4f3
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -1128,19 +1128,26 @@ static ssize_t available_frequencies_show(struct device *d,
	struct devfreq *df = to_devfreq(d);
	struct device *dev = df->dev.parent;
	struct dev_pm_opp *opp;
	unsigned int i = 0, max_state = df->profile->max_state;
	bool use_opp;
	ssize_t count = 0;
	unsigned long freq = 0;

	use_opp = dev_pm_opp_get_opp_count(dev) > 0;
	do {
		if (use_opp) {
			opp = dev_pm_opp_find_freq_ceil(dev, &freq);
			if (IS_ERR(opp))
				break;
		} else {
			freq = df->profile->freq_table[i++];
		}

		dev_pm_opp_put(opp);
		count += scnprintf(&buf[count], (PAGE_SIZE - count - 2),
				   "%lu ", freq);
		freq++;
	} while (1);
	} while (use_opp || (!use_opp && i < max_state));

	/* Truncate the trailing space */
	if (count)