On Thu, Oct 10, 2019 at 01:39:28PM +0200, Ulf Hansson wrote: > The CPU's idle state nodes are currently parsed at the common cpuidle DT > library, but also when initializing data for specific CPU idle operations, > as in the PSCI cpuidle driver case and qcom-spm cpuidle case. > > To avoid open-coding, let's introduce of_get_cpu_state_node(), which takes > the device node for the CPU and the index to the requested idle state node, > as in-parameters. In case a corresponding idle state node is found, it > returns the node with the refcount incremented for it, else it returns > NULL. > > Moreover, for PSCI there are two options to describe the CPU's idle states > [1], either via a flattened description or a hierarchical layout. Hence, > let's take both options into account. > > [1] Documentation/devicetree/bindings/arm/psci.yaml > > Suggested-by: Sudeep Holla <sudeep.holla@xxxxxxx> Reviewed-by: Sudeep Holla <sudeep.holla@xxxxxxx> -- Regards, Sudeep