aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/cpuidle.h
diff options
context:
space:
mode:
authorXunlei Pang <pang.xunlei@linaro.org>2015-08-30 23:34:05 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-09-02 21:05:47 -0400
commitabceaa9cded5f059f8c3b3b6f32730084fe5e39f (patch)
tree8f4cfa6f48e5ed6b6eee71ba4d2b7c334a705ba9 /drivers/cpuidle/cpuidle.h
parent4c1ed5a6079078699128064664913ae7b079648f (diff)
cpuidle/coupled: Add sanity check for safe_state_index
Since we are using cpuidle_driver::safe_state_index directly as the target state index, it is better to add the sanity check at the point of registering the driver. Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle/cpuidle.h')
-rw-r--r--drivers/cpuidle/cpuidle.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h
index 178c5ad3d568..f87f399b0540 100644
--- a/drivers/cpuidle/cpuidle.h
+++ b/drivers/cpuidle/cpuidle.h
@@ -35,6 +35,7 @@ extern void cpuidle_remove_sysfs(struct cpuidle_device *dev);
35 35
36#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED 36#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
37bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state); 37bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state);
38int cpuidle_coupled_state_verify(struct cpuidle_driver *drv);
38int cpuidle_enter_state_coupled(struct cpuidle_device *dev, 39int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
39 struct cpuidle_driver *drv, int next_state); 40 struct cpuidle_driver *drv, int next_state);
40int cpuidle_coupled_register_device(struct cpuidle_device *dev); 41int cpuidle_coupled_register_device(struct cpuidle_device *dev);
@@ -46,6 +47,11 @@ bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state)
46 return false; 47 return false;
47} 48}
48 49
50static inline int cpuidle_coupled_state_verify(struct cpuidle_driver *drv)
51{
52 return 0;
53}
54
49static inline int cpuidle_enter_state_coupled(struct cpuidle_device *dev, 55static inline int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
50 struct cpuidle_driver *drv, int next_state) 56 struct cpuidle_driver *drv, int next_state)
51{ 57{