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>
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));