diff options
author | Jon Medhurst <tixy@linaro.org> | 2012-07-25 15:13:46 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2013-07-01 11:05:12 +0100 |
commit | e7fd319fd055450dce5ff4f07fa2012f103e9413 (patch) | |
tree | 521a6500e098a564c975c649acec35084f981624 | |
parent | 88d444dfb9e5776c0234e37eeea5bf1a37f8a71f (diff) |
ARM: vexpress: Make cpuidle check for presence of SPC driver
The cpuidle code requires SPC hardware, so check for its presence
before initialising. This enables the cpuidle code to safely exist
in kernels run on hardware without SPC support.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r-- | arch/arm/mach-vexpress/cpuidle-tc2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/mach-vexpress/cpuidle-tc2.c b/arch/arm/mach-vexpress/cpuidle-tc2.c index de66243a7ef..3b73d4a5dc5 100644 --- a/arch/arm/mach-vexpress/cpuidle-tc2.c +++ b/arch/arm/mach-vexpress/cpuidle-tc2.c @@ -221,6 +221,11 @@ int __init tc2_idle_init(void) struct dentry *idle_debug, *file_debug; struct cpuidle_driver *drv = &tc2_idle_driver; + if (!vexpress_spc_check_loaded()) { + pr_info("TC2 CPUidle not registered because no SPC found\n"); + return -ENODEV; + } + drv->state_count = (sizeof(tc2_cpuidle_set) / sizeof(struct cpuidle_state)); |