1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

module/cpufreq: Sort list of frequencies

Ensure the order of frequencies is deterministic to have consistent output when
printing it or when using it to carry out some actions.
This commit is contained in:
Douglas RAILLARD 2020-01-15 11:32:44 +00:00 committed by Marc Bonnici
parent 5bda1c0eee
commit 6fe78b4d47

View File

@ -212,7 +212,7 @@ class CpufreqModule(Module):
@memoized
def list_frequencies(self, cpu):
"""Returns a list of frequencies supported by the cpu or an empty list
"""Returns a sorted list of frequencies supported by the cpu or an empty list
if not could be found."""
if isinstance(cpu, int):
cpu = 'cpu{}'.format(cpu)
@ -234,7 +234,7 @@ class CpufreqModule(Module):
raise
available_frequencies = list(map(int, reversed([f for f, _ in zip(out_iter, out_iter)])))
return available_frequencies
return sorted(available_frequencies)
@memoized
def get_max_available_frequency(self, cpu):