aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-27 17:26:18 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:30:59 -0400
commit167cffb646aa4a7f3267b07eae1af16b54bc0e9b (patch)
tree9cce5186f359c8956343a0fe391aebd579c1b02e /drivers/acpi
parent62fcbdd95ccabcff7b41a859032496f6ca492045 (diff)
ACPI: Use struct dev_pm_ops for power management in the thermal driver
Make the ACPI thermal driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct acpi_device_ops. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/thermal.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 7dbebea1ec31..21dd4c268aef 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -98,7 +98,6 @@ MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
98 98
99static int acpi_thermal_add(struct acpi_device *device); 99static int acpi_thermal_add(struct acpi_device *device);
100static int acpi_thermal_remove(struct acpi_device *device, int type); 100static int acpi_thermal_remove(struct acpi_device *device, int type);
101static int acpi_thermal_resume(struct acpi_device *device);
102static void acpi_thermal_notify(struct acpi_device *device, u32 event); 101static void acpi_thermal_notify(struct acpi_device *device, u32 event);
103 102
104static const struct acpi_device_id thermal_device_ids[] = { 103static const struct acpi_device_id thermal_device_ids[] = {
@@ -107,6 +106,9 @@ static const struct acpi_device_id thermal_device_ids[] = {
107}; 106};
108MODULE_DEVICE_TABLE(acpi, thermal_device_ids); 107MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
109 108
109static int acpi_thermal_resume(struct device *dev);
110static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume);
111
110static struct acpi_driver acpi_thermal_driver = { 112static struct acpi_driver acpi_thermal_driver = {
111 .name = "thermal", 113 .name = "thermal",
112 .class = ACPI_THERMAL_CLASS, 114 .class = ACPI_THERMAL_CLASS,
@@ -114,9 +116,9 @@ static struct acpi_driver acpi_thermal_driver = {
114 .ops = { 116 .ops = {
115 .add = acpi_thermal_add, 117 .add = acpi_thermal_add,
116 .remove = acpi_thermal_remove, 118 .remove = acpi_thermal_remove,
117 .resume = acpi_thermal_resume,
118 .notify = acpi_thermal_notify, 119 .notify = acpi_thermal_notify,
119 }, 120 },
121 .drv.pm = &acpi_thermal_pm,
120}; 122};
121 123
122struct acpi_thermal_state { 124struct acpi_thermal_state {
@@ -1041,16 +1043,17 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
1041 return 0; 1043 return 0;
1042} 1044}
1043 1045
1044static int acpi_thermal_resume(struct acpi_device *device) 1046static int acpi_thermal_resume(struct device *dev)
1045{ 1047{
1046 struct acpi_thermal *tz = NULL; 1048 struct acpi_thermal *tz;
1047 int i, j, power_state, result; 1049 int i, j, power_state, result;
1048 1050
1049 1051 if (!dev)
1050 if (!device || !acpi_driver_data(device))
1051 return -EINVAL; 1052 return -EINVAL;
1052 1053
1053 tz = acpi_driver_data(device); 1054 tz = acpi_driver_data(to_acpi_device(dev));
1055 if (!tz)
1056 return -EINVAL;
1054 1057
1055 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { 1058 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
1056 if (!(&tz->trips.active[i])) 1059 if (!(&tz->trips.active[i]))