diff options
author | Aaron Lu <aaron.lu@intel.com> | 2014-02-18 23:16:48 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-20 15:42:09 -0500 |
commit | b9b8515f34fa182e26ee934c3a83f24e2d8bd846 (patch) | |
tree | de5413f115b9f0fd410a9c78a5010ec06cd9e7e7 | |
parent | 5e2e46e84b6f77d4f8e51d6e33ff8eb0f47288f2 (diff) |
ACPI / fan: do nothing in suspend and poweroff callback
We put fans to full speed in acpi_fan_suspend(), but that is only
needed in the hibernation case when we are generating hibernation
image, so this patch removes that when we are about to suspend or
poweroff.
References: http://www.spinics.net/lists/linux-acpi/msg48636.html
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/fan.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 09e423f3d8ad..8acf53e62966 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -55,11 +55,16 @@ MODULE_DEVICE_TABLE(acpi, fan_device_ids); | |||
55 | #ifdef CONFIG_PM_SLEEP | 55 | #ifdef CONFIG_PM_SLEEP |
56 | static int acpi_fan_suspend(struct device *dev); | 56 | static int acpi_fan_suspend(struct device *dev); |
57 | static int acpi_fan_resume(struct device *dev); | 57 | static int acpi_fan_resume(struct device *dev); |
58 | static struct dev_pm_ops acpi_fan_pm = { | ||
59 | .resume = acpi_fan_resume, | ||
60 | .freeze = acpi_fan_suspend, | ||
61 | .thaw = acpi_fan_resume, | ||
62 | .restore = acpi_fan_resume, | ||
63 | }; | ||
64 | #define FAN_PM_OPS_PTR (&acpi_fan_pm) | ||
58 | #else | 65 | #else |
59 | #define acpi_fan_suspend NULL | 66 | #define FAN_PM_OPS_PTR NULL |
60 | #define acpi_fan_resume NULL | ||
61 | #endif | 67 | #endif |
62 | static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume); | ||
63 | 68 | ||
64 | static struct acpi_driver acpi_fan_driver = { | 69 | static struct acpi_driver acpi_fan_driver = { |
65 | .name = "fan", | 70 | .name = "fan", |
@@ -69,7 +74,7 @@ static struct acpi_driver acpi_fan_driver = { | |||
69 | .add = acpi_fan_add, | 74 | .add = acpi_fan_add, |
70 | .remove = acpi_fan_remove, | 75 | .remove = acpi_fan_remove, |
71 | }, | 76 | }, |
72 | .drv.pm = &acpi_fan_pm, | 77 | .drv.pm = FAN_PM_OPS_PTR, |
73 | }; | 78 | }; |
74 | 79 | ||
75 | /* thermal cooling device callbacks */ | 80 | /* thermal cooling device callbacks */ |