]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ACPI: Use struct dev_pm_ops for power management in processor driver
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 27 Jun 2012 21:26:26 +0000 (23:26 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 1 Jul 2012 11:31:00 +0000 (13:31 +0200)
Make the ACPI processor 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>
drivers/acpi/processor_driver.c
drivers/acpi/processor_idle.c
include/acpi/processor.h

index 0734086537b89732ba805158389b904e94ae7ecf..13103aeb0c4f449675b7a4554e5eb071d3c153f6 100644 (file)
@@ -93,6 +93,9 @@ static const struct acpi_device_id processor_device_ids[] = {
 };
 MODULE_DEVICE_TABLE(acpi, processor_device_ids);
 
+static SIMPLE_DEV_PM_OPS(acpi_processor_pm,
+                        acpi_processor_suspend, acpi_processor_resume);
+
 static struct acpi_driver acpi_processor_driver = {
        .name = "processor",
        .class = ACPI_PROCESSOR_CLASS,
@@ -100,10 +103,9 @@ static struct acpi_driver acpi_processor_driver = {
        .ops = {
                .add = acpi_processor_add,
                .remove = acpi_processor_remove,
-               .suspend = acpi_processor_suspend,
-               .resume = acpi_processor_resume,
                .notify = acpi_processor_notify,
                },
+       .drv.pm = &acpi_processor_pm,
 };
 
 #define INSTALL_NOTIFY_HANDLER         1
index e28af8d382397eba4e004f9219d2a25bcdbe854d..6d9ec3e0b52e725488c8116264065f258a0104b5 100644 (file)
@@ -241,7 +241,7 @@ static void acpi_idle_bm_rld_restore(void)
                acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
 }
 
-int acpi_processor_suspend(struct acpi_device * device)
+int acpi_processor_suspend(struct device *dev)
 {
        if (acpi_idle_suspend == 1)
                return 0;
@@ -251,7 +251,7 @@ int acpi_processor_suspend(struct acpi_device * device)
        return 0;
 }
 
-int acpi_processor_resume(struct acpi_device * device)
+int acpi_processor_resume(struct device *dev)
 {
        if (acpi_idle_suspend == 0)
                return 0;
index 8a1894a6eba2bae19508e381f79f3c0dbba1ef27..ac3bff6fbbb08f11a866111b98a75c3fb66dd19c 100644 (file)
@@ -334,8 +334,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr);
 int acpi_processor_hotplug(struct acpi_processor *pr);
 int acpi_processor_power_exit(struct acpi_processor *pr,
                              struct acpi_device *device);
-int acpi_processor_suspend(struct acpi_device * device);
-int acpi_processor_resume(struct acpi_device * device);
+int acpi_processor_suspend(struct device *dev);
+int acpi_processor_resume(struct device *dev);
 extern struct cpuidle_driver acpi_idle_driver;
 
 /* in processor_thermal.c */