1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 02:40:50 +01:00

module/cpuidle: ensure get_states() returns a list

Ensure that cpuidle.get_states() always returns a list, even if no idle
states are available on the target.
This commit is contained in:
Sergei Trofimov 2018-05-22 12:18:51 +01:00 committed by Marc Bonnici
parent 329df6f42e
commit d6ccbb44c3

View File

@ -132,7 +132,7 @@ class Cpuidle(Module):
def get_states(self, cpu=0):
if isinstance(cpu, int):
cpu = 'cpu{}'.format(cpu)
return self._states.get(cpu)
return self._states.get(cpu, [])
def get_state(self, state, cpu=0):
if isinstance(state, int):