summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2022-10-21 17:10:12 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-10-28 20:07:28 +0200
commitee3c2c8ad6ba6785f14a60e4081d7c82e88162a2 (patch)
tree8727e14a61a17383813c93d0990503c48153492c /drivers/cpuidle
parent668057b07db069daac3ca4e4978f8373db9cb71c (diff)
downloadlinux-ee3c2c8ad6ba6785f14a60e4081d7c82e88162a2.tar.bz2
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: 9f14da345599 ("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>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/dt_idle_states.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
index 252f2a9686a6..448bc796b0b4 100644
--- a/drivers/cpuidle/dt_idle_states.c
+++ b/drivers/cpuidle/dt_idle_states.c
@@ -223,6 +223,6 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
* also be 0 on platforms with missing DT idle states or legacy DT
* configuration predating the DT idle states bindings.
*/
- return i;
+ return state_idx - start_idx;
}
EXPORT_SYMBOL_GPL(dt_init_idle_driver);