diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-06-29 23:40:05 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-01 13:31:05 +0200 |
commit | c5dec0182256361a3f823316e8fb85263f76efe7 (patch) | |
tree | a4143954a3e9960a6f5c129e9a57990b50786742 /drivers/hwmon | |
parent | d26c844bc1c5e9745deffccae8d205e9b77a0fb1 (diff) | |
download | linux-stable-c5dec0182256361a3f823316e8fb85263f76efe7.tar.gz linux-stable-c5dec0182256361a3f823316e8fb85263f76efe7.tar.bz2 linux-stable-c5dec0182256361a3f823316e8fb85263f76efe7.zip |
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')
-rw-r--r-- | drivers/hwmon/acpi_power_meter.c | 13 |
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) return 0; } -static int acpi_power_meter_resume(struct acpi_device *device) +static int acpi_power_meter_resume(struct device *dev) { struct acpi_power_meter_resource *resource; - if (!device || !acpi_driver_data(device)) + if (!dev) + return -EINVAL; + + resource = acpi_driver_data(to_acpi_device(dev)); + if (!resource) return -EINVAL; - resource = acpi_driver_data(device); free_capabilities(resource); read_capabilities(resource); return 0; } +static SIMPLE_DEV_PM_OPS(acpi_power_meter_pm, NULL, acpi_power_meter_resume); + static struct acpi_driver acpi_power_meter_driver = { .name = "power_meter", .class = ACPI_POWER_METER_CLASS, @@ -950,9 +955,9 @@ static struct acpi_driver acpi_power_meter_driver = { .ops = { .add = acpi_power_meter_add, .remove = acpi_power_meter_remove, - .resume = acpi_power_meter_resume, .notify = acpi_power_meter_notify, }, + .drv.pm = &acpi_power_meter_pm, }; /* Module init/exit routines */ |