mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-06 03:51:54 +01: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:
@@ -113,7 +113,7 @@ class Cpuidle(Module):
|
|||||||
def get_state(self, state, cpu=0):
|
def get_state(self, state, cpu=0):
|
||||||
if isinstance(state, int):
|
if isinstance(state, int):
|
||||||
try:
|
try:
|
||||||
self.get_states(cpu)[state].enable()
|
return self.get_states(cpu)[state]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise ValueError('Cpuidle state {} does not exist'.format(state))
|
raise ValueError('Cpuidle state {} does not exist'.format(state))
|
||||||
else: # assume string-like
|
else: # assume string-like
|
||||||
|
Reference in New Issue
Block a user