aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/acpi_power_meter.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-29 17:40:05 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:05 -0400
commitc5dec0182256361a3f823316e8fb85263f76efe7 (patch)
treea4143954a3e9960a6f5c129e9a57990b50786742 /drivers/hwmon/acpi_power_meter.c
parentd26c844bc1c5e9745deffccae8d205e9b77a0fb1 (diff)
acpi_power_meter: Use struct dev_pm_ops for power management
Make the ACPI power meter 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/hwmon/acpi_power_meter.c')
-rw-r--r--drivers/hwmon/acpi_power_meter.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 34ad5a27a7e9..e3fcf8146834 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -929,20 +929,25 @@ static int acpi_power_meter_remove(struct acpi_device *device, int type)
929 return 0; 929 return 0;
930} 930}
931 931
932static int acpi_power_meter_resume(struct acpi_device *device) 932static int acpi_power_meter_resume(struct device *dev)
933{ 933{
934 struct acpi_power_meter_resource *resource; 934 struct acpi_power_meter_resource *resource;
935 935
936 if (!device || !acpi_driver_data(device)) 936 if (!dev)
937 return -EINVAL;
938
939 resource = acpi_driver_data(to_acpi_device(dev));
940 if (!resource)
937 return -EINVAL; 941 return -EINVAL;
938 942
939 resource = acpi_driver_data(device);
940 free_capabilities(resource); 943 free_capabilities(resource);
941 read_capabilities(resource); 944 read_capabilities(resource);
942 945
943 return 0; 946 return 0;
944} 947}
945 948
949static SIMPLE_DEV_PM_OPS(acpi_power_meter_pm, NULL, acpi_power_meter_resume);
950
946static struct acpi_driver acpi_power_meter_driver = { 951static struct acpi_driver acpi_power_meter_driver = {
947 .name = "power_meter", 952 .name = "power_meter",
948 .class = ACPI_POWER_METER_CLASS, 953 .class = ACPI_POWER_METER_CLASS,
@@ -950,9 +955,9 @@ static struct acpi_driver acpi_power_meter_driver = {
950 .ops = { 955 .ops = {
951 .add = acpi_power_meter_add, 956 .add = acpi_power_meter_add,
952 .remove = acpi_power_meter_remove, 957 .remove = acpi_power_meter_remove,
953 .resume = acpi_power_meter_resume,
954 .notify = acpi_power_meter_notify, 958 .notify = acpi_power_meter_notify,
955 }, 959 },
960 .drv.pm = &acpi_power_meter_pm,
956}; 961};
957 962
958/* Module init/exit routines */ 963/* Module init/exit routines */