mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00: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:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							329df6f42e
						
					
				
				
					commit
					d6ccbb44c3
				
			@@ -132,7 +132,7 @@ class Cpuidle(Module):
 | 
				
			|||||||
    def get_states(self, cpu=0):
 | 
					    def get_states(self, cpu=0):
 | 
				
			||||||
        if isinstance(cpu, int):
 | 
					        if isinstance(cpu, int):
 | 
				
			||||||
            cpu = 'cpu{}'.format(cpu)
 | 
					            cpu = 'cpu{}'.format(cpu)
 | 
				
			||||||
        return self._states.get(cpu)
 | 
					        return self._states.get(cpu, [])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_state(self, state, cpu=0):
 | 
					    def get_state(self, state, cpu=0):
 | 
				
			||||||
        if isinstance(state, int):
 | 
					        if isinstance(state, int):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user