Commit 4d2b6e4a authored by Mathias Krause's avatar Mathias Krause Committed by Zhang Rui

thermal/intel_powerclamp: add __init / __exit annotations

Mark the module init / exit functions with __init / __exit accodingly.
This allows making the intel_powerclamp_ids[] array __initconst, too, as
it only gets referenced from powerclamp_probe(). This is safe as
file2alias doesn't care about the section, but the symbol name for the
MODULE_DEVICE_TABLE alias.

Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
Acked-by: default avatarJacob Pan <jacob.jun.pan@linux.intel.com>
Acked-by: default avatarJacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent ce1d9491
...@@ -667,7 +667,7 @@ static struct thermal_cooling_device_ops powerclamp_cooling_ops = { ...@@ -667,7 +667,7 @@ static struct thermal_cooling_device_ops powerclamp_cooling_ops = {
}; };
/* runs on Nehalem and later */ /* runs on Nehalem and later */
static const struct x86_cpu_id intel_powerclamp_ids[] = { static const struct x86_cpu_id intel_powerclamp_ids[] __initconst = {
{ X86_VENDOR_INTEL, 6, 0x1a}, { X86_VENDOR_INTEL, 6, 0x1a},
{ X86_VENDOR_INTEL, 6, 0x1c}, { X86_VENDOR_INTEL, 6, 0x1c},
{ X86_VENDOR_INTEL, 6, 0x1e}, { X86_VENDOR_INTEL, 6, 0x1e},
...@@ -694,7 +694,7 @@ static const struct x86_cpu_id intel_powerclamp_ids[] = { ...@@ -694,7 +694,7 @@ static const struct x86_cpu_id intel_powerclamp_ids[] = {
}; };
MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids); MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids);
static int powerclamp_probe(void) static int __init powerclamp_probe(void)
{ {
if (!x86_match_cpu(intel_powerclamp_ids)) { if (!x86_match_cpu(intel_powerclamp_ids)) {
pr_err("Intel powerclamp does not run on family %d model %d\n", pr_err("Intel powerclamp does not run on family %d model %d\n",
...@@ -760,7 +760,7 @@ static inline void powerclamp_create_debug_files(void) ...@@ -760,7 +760,7 @@ static inline void powerclamp_create_debug_files(void)
debugfs_remove_recursive(debug_dir); debugfs_remove_recursive(debug_dir);
} }
static int powerclamp_init(void) static int __init powerclamp_init(void)
{ {
int retval; int retval;
int bitmap_size; int bitmap_size;
...@@ -809,7 +809,7 @@ static int powerclamp_init(void) ...@@ -809,7 +809,7 @@ static int powerclamp_init(void)
} }
module_init(powerclamp_init); module_init(powerclamp_init);
static void powerclamp_exit(void) static void __exit powerclamp_exit(void)
{ {
unregister_hotcpu_notifier(&powerclamp_cpu_notifier); unregister_hotcpu_notifier(&powerclamp_cpu_notifier);
end_power_clamp(); end_power_clamp();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment