diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-02-04 17:44:42 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2013-02-08 18:44:51 -0500 |
commit | 6ef0f086beafb3c7d81cd3de81d886d105ea25b2 (patch) | |
tree | 4ba11f2a38aca41ac1d0ec0f32464b2374de6c31 /drivers/acpi | |
parent | e2668fb53ffd3e01c3116f65a9047a25e4c66399 (diff) |
ACPI / idle: pass the cpuidle_device parameter
The cpuidle_device is retrieved in the function by using directly
the global variable. But the caller of this function already have
this device and it can be passed as a parameter. That is one small
step to encapsulate the code more.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/processor_idle.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 82626e9abe78..68370659df68 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -928,13 +928,14 @@ struct cpuidle_driver acpi_idle_driver = { | |||
928 | * device i.e. per-cpu data | 928 | * device i.e. per-cpu data |
929 | * | 929 | * |
930 | * @pr: the ACPI processor | 930 | * @pr: the ACPI processor |
931 | * @dev : the cpuidle device | ||
931 | */ | 932 | */ |
932 | static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr) | 933 | static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, |
934 | struct cpuidle_device *dev) | ||
933 | { | 935 | { |
934 | int i, count = CPUIDLE_DRIVER_STATE_START; | 936 | int i, count = CPUIDLE_DRIVER_STATE_START; |
935 | struct acpi_processor_cx *cx; | 937 | struct acpi_processor_cx *cx; |
936 | struct cpuidle_state_usage *state_usage; | 938 | struct cpuidle_state_usage *state_usage; |
937 | struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id); | ||
938 | 939 | ||
939 | if (!pr->flags.power_setup_done) | 940 | if (!pr->flags.power_setup_done) |
940 | return -EINVAL; | 941 | return -EINVAL; |
@@ -1089,7 +1090,7 @@ int acpi_processor_hotplug(struct acpi_processor *pr) | |||
1089 | cpuidle_disable_device(dev); | 1090 | cpuidle_disable_device(dev); |
1090 | acpi_processor_get_power_info(pr); | 1091 | acpi_processor_get_power_info(pr); |
1091 | if (pr->flags.power) { | 1092 | if (pr->flags.power) { |
1092 | acpi_processor_setup_cpuidle_cx(pr); | 1093 | acpi_processor_setup_cpuidle_cx(pr, dev); |
1093 | ret = cpuidle_enable_device(dev); | 1094 | ret = cpuidle_enable_device(dev); |
1094 | } | 1095 | } |
1095 | cpuidle_resume_and_unlock(); | 1096 | cpuidle_resume_and_unlock(); |
@@ -1147,8 +1148,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) | |||
1147 | continue; | 1148 | continue; |
1148 | acpi_processor_get_power_info(_pr); | 1149 | acpi_processor_get_power_info(_pr); |
1149 | if (_pr->flags.power) { | 1150 | if (_pr->flags.power) { |
1150 | acpi_processor_setup_cpuidle_cx(_pr); | ||
1151 | dev = per_cpu(acpi_cpuidle_device, cpu); | 1151 | dev = per_cpu(acpi_cpuidle_device, cpu); |
1152 | acpi_processor_setup_cpuidle_cx(_pr, dev); | ||
1152 | cpuidle_enable_device(dev); | 1153 | cpuidle_enable_device(dev); |
1153 | } | 1154 | } |
1154 | } | 1155 | } |
@@ -1217,7 +1218,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr) | |||
1217 | return -ENOMEM; | 1218 | return -ENOMEM; |
1218 | per_cpu(acpi_cpuidle_device, pr->id) = dev; | 1219 | per_cpu(acpi_cpuidle_device, pr->id) = dev; |
1219 | 1220 | ||
1220 | acpi_processor_setup_cpuidle_cx(pr); | 1221 | acpi_processor_setup_cpuidle_cx(pr, dev); |
1221 | 1222 | ||
1222 | /* Register per-cpu cpuidle_device. Cpuidle driver | 1223 | /* Register per-cpu cpuidle_device. Cpuidle driver |
1223 | * must already be registered before registering device | 1224 | * must already be registered before registering device |