summaryrefslogtreecommitdiffstats
path: root/drivers/idle
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-01-10 11:49:58 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-01-23 00:37:01 +0100
commit0755a9bd9963ec3d611129cf2cdbb3e041ccbd6a (patch)
tree86da002c8ea9fb9511b4f44710a1d684affa7c02 /drivers/idle
parentintel_idle: Rearrange intel_idle_cpuidle_driver_init() (diff)
downloadlinux-0755a9bd9963ec3d611129cf2cdbb3e041ccbd6a.tar.xz
linux-0755a9bd9963ec3d611129cf2cdbb3e041ccbd6a.zip
intel_idle: Move and clean up intel_idle_cpuidle_devices_uninit()
Move intel_idle_cpuidle_devices_uninit() closer to its caller, intel_idle_init(), add the __init modifier to its header, drop a redundant local variable from it and fix up its kerneldoc comment. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/idle')
-rw-r--r--drivers/idle/intel_idle.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index c535b0b55ea5..9841046dfd32 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1297,21 +1297,6 @@ static inline bool intel_idle_off_by_default(u32 mwait_hint) { return false; }
#endif /* !CONFIG_ACPI_PROCESSOR_CSTATE */
/*
- * intel_idle_cpuidle_devices_uninit()
- * Unregisters the cpuidle devices.
- */
-static void intel_idle_cpuidle_devices_uninit(void)
-{
- int i;
- struct cpuidle_device *dev;
-
- for_each_online_cpu(i) {
- dev = per_cpu_ptr(intel_idle_cpuidle_devices, i);
- cpuidle_unregister_device(dev);
- }
-}
-
-/*
* ivt_idle_state_table_update(void)
*
* Tune IVT multi-socket targets
@@ -1565,6 +1550,17 @@ static int intel_idle_cpu_online(unsigned int cpu)
return 0;
}
+/**
+ * intel_idle_cpuidle_devices_uninit - Unregister all cpuidle devices.
+ */
+static void __init intel_idle_cpuidle_devices_uninit(void)
+{
+ int i;
+
+ for_each_online_cpu(i)
+ cpuidle_unregister_device(per_cpu_ptr(intel_idle_cpuidle_devices, i));
+}
+
static int __init intel_idle_init(void)
{
const struct x86_cpu_id *id;