cpuidle: dt: Clarify a comment and simplify code in dt_init_idle_driver()
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 21 Oct 2022 15:10:13 +0000 (17:10 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 28 Oct 2022 18:07:28 +0000 (20:07 +0200)
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>
drivers/cpuidle/dt_idle_states.c

index 448bc79..7ca3d7d 100644 (file)
@@ -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