This patch adds a pointer to the cpuidle_state array in the cpuidle_device structure. When the cpuidle_device is initialized, the pointer is assigned from the driver's cpuidle states array.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- drivers/cpuidle/cpuidle.c | 1 + include/linux/cpuidle.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index d6a533e..42b1a8a 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -305,6 +305,7 @@ int cpuidle_enable_device(struct cpuidle_device *dev) return -EIO; if (!dev->state_count) dev->state_count = drv->state_count; + dev->states = drv->states;
if (dev->registered == 0) { ret = __cpuidle_register_device(dev); diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 89dcd30..40a04a1 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -95,6 +95,7 @@ struct cpuidle_device {
int last_residency; int state_count; + struct cpuidle_state *states; struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];