From d6ccbb44c306b4f9e12422372d5f13e0017e46df Mon Sep 17 00:00:00 2001
From: Sergei Trofimov <sergei.trofimov@arm.com>
Date: Tue, 22 May 2018 12:18:51 +0100
Subject: [PATCH] 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.
---
 devlib/module/cpuidle.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devlib/module/cpuidle.py b/devlib/module/cpuidle.py
index 4cbb315..6073455 100644
--- a/devlib/module/cpuidle.py
+++ b/devlib/module/cpuidle.py
@@ -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):