Skip to content

Commit ee3c2c8

Browse files
Ulf Hanssonrafaeljw
authored andcommitted
cpuidle: dt: Return the correct numbers of parsed idle states
While we correctly skips to initialize an idle state from a disabled idle state node in DT, the returned value from dt_init_idle_driver() don't get adjusted accordingly. Instead the number of found idle state nodes are returned, while the callers are expecting the number of successfully initialized idle states from DT. This leads to cpuidle drivers unnecessarily continues to initialize their idle state specific data. Moreover, in the case when all idle states have been disabled in DT, we would end up registering a cpuidle driver, rather than relying on the default arch specific idle call. Fixes: 9f14da3 ("drivers: cpuidle: implement DT based idle states infrastructure") Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 668057b commit ee3c2c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/cpuidle/dt_idle_states.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,6 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
223223
* also be 0 on platforms with missing DT idle states or legacy DT
224224
* configuration predating the DT idle states bindings.
225225
*/
226-
return i;
226+
return state_idx - start_idx;
227227
}
228228
EXPORT_SYMBOL_GPL(dt_init_idle_driver);

0 commit comments

Comments
 (0)