summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2022-10-21 17:10:13 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-10-28 20:07:28 +0200
commitcb51aeec147334d25fa8336d3334ea92e2134052 (patch)
tree7b9a9d71eee311d2a444a705812ba7b8b45e5ba4 /drivers/cpuidle
parentee3c2c8ad6ba6785f14a60e4081d7c82e88162a2 (diff)
downloadlinux-cb51aeec147334d25fa8336d3334ea92e2134052.tar.bz2
cpuidle: dt: Clarify a comment and simplify code in dt_init_idle_driver()
The drv->state_count is assigned the total number of available states, so let's make that clear. 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.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
index 448bc796b0b4..7ca3d7d9b5ea 100644
--- a/drivers/cpuidle/dt_idle_states.c
+++ b/drivers/cpuidle/dt_idle_states.c
@@ -211,12 +211,9 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
of_node_put(cpu_node);
if (err)
return err;
- /*
- * Update the driver state count only if some valid DT idle states
- * were detected
- */
- if (i)
- drv->state_count = state_idx;
+
+ /* Set the number of total supported idle states. */
+ drv->state_count = state_idx;
/*
* Return the number of present and valid DT idle states, which can