mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
cgroups: fix get_states() return value when passing integer state
When passing an idle state ID to get_states(), nothing is returned. Also, there is a wrong call to enable() in the method. Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
This commit is contained in:
parent
0c8f26763b
commit
f9cb932d9c
@ -113,7 +113,7 @@ class Cpuidle(Module):
|
||||
def get_state(self, state, cpu=0):
|
||||
if isinstance(state, int):
|
||||
try:
|
||||
self.get_states(cpu)[state].enable()
|
||||
return self.get_states(cpu)[state]
|
||||
except IndexError:
|
||||
raise ValueError('Cpuidle state {} does not exist'.format(state))
|
||||
else: # assume string-like
|
||||
|
Loading…
x
Reference in New Issue
Block a user