Skip to content

Commit 0755a9b

Browse files
committed
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>
1 parent 3d3a1ae commit 0755a9b

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

‎drivers/idle/intel_idle.c‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,21 +1296,6 @@ static inline void intel_idle_init_cstates_acpi(struct cpuidle_driver *drv) { }
12961296
static inline bool intel_idle_off_by_default(u32 mwait_hint) { return false; }
12971297
#endif /* !CONFIG_ACPI_PROCESSOR_CSTATE */
12981298

1299-
/*
1300-
* intel_idle_cpuidle_devices_uninit()
1301-
* Unregisters the cpuidle devices.
1302-
*/
1303-
static void intel_idle_cpuidle_devices_uninit(void)
1304-
{
1305-
int i;
1306-
struct cpuidle_device *dev;
1307-
1308-
for_each_online_cpu(i) {
1309-
dev = per_cpu_ptr(intel_idle_cpuidle_devices, i);
1310-
cpuidle_unregister_device(dev);
1311-
}
1312-
}
1313-
13141299
/*
13151300
* ivt_idle_state_table_update(void)
13161301
*
@@ -1565,6 +1550,17 @@ static int intel_idle_cpu_online(unsigned int cpu)
15651550
return 0;
15661551
}
15671552

1553+
/**
1554+
* intel_idle_cpuidle_devices_uninit - Unregister all cpuidle devices.
1555+
*/
1556+
static void __init intel_idle_cpuidle_devices_uninit(void)
1557+
{
1558+
int i;
1559+
1560+
for_each_online_cpu(i)
1561+
cpuidle_unregister_device(per_cpu_ptr(intel_idle_cpuidle_devices, i));
1562+
}
1563+
15681564
static int __init intel_idle_init(void)
15691565
{
15701566
const struct x86_cpu_id *id;

0 commit comments

Comments
 (0)