Skip to content

Commit cb51aee

Browse files
Ulf Hanssonrafaeljw
authored andcommitted
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>
1 parent ee3c2c8 commit cb51aee

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/cpuidle/dt_idle_states.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,9 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
211211
of_node_put(cpu_node);
212212
if (err)
213213
return err;
214-
/*
215-
* Update the driver state count only if some valid DT idle states
216-
* were detected
217-
*/
218-
if (i)
219-
drv->state_count = state_idx;
214+
215+
/* Set the number of total supported idle states. */
216+
drv->state_count = state_idx;
220217

221218
/*
222219
* Return the number of present and valid DT idle states, which can

0 commit comments

Comments
 (0)