aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-27 17:26:51 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:01 -0400
commit1be532de834ab7b18ce20dc2e56e724770beb79d (patch)
tree69ae4f0f142120c8a33733054c97290fa3fe6057
parenta6f50dc8ef26819c510cda84477dd60e3d1c90bb (diff)
ACPI: Use struct dev_pm_ops for power management in the button driver
Make the ACPI button 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>
-rw-r--r--drivers/acpi/button.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index d27d072472f9..79d4c22f7a6d 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -76,19 +76,21 @@ MODULE_DEVICE_TABLE(acpi, button_device_ids);
76 76
77static int acpi_button_add(struct acpi_device *device); 77static int acpi_button_add(struct acpi_device *device);
78static int acpi_button_remove(struct acpi_device *device, int type); 78static int acpi_button_remove(struct acpi_device *device, int type);
79static int acpi_button_resume(struct acpi_device *device);
80static void acpi_button_notify(struct acpi_device *device, u32 event); 79static void acpi_button_notify(struct acpi_device *device, u32 event);
81 80
81static int acpi_button_resume(struct device *dev);
82static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume);
83
82static struct acpi_driver acpi_button_driver = { 84static struct acpi_driver acpi_button_driver = {
83 .name = "button", 85 .name = "button",
84 .class = ACPI_BUTTON_CLASS, 86 .class = ACPI_BUTTON_CLASS,
85 .ids = button_device_ids, 87 .ids = button_device_ids,
86 .ops = { 88 .ops = {
87 .add = acpi_button_add, 89 .add = acpi_button_add,
88 .resume = acpi_button_resume,
89 .remove = acpi_button_remove, 90 .remove = acpi_button_remove,
90 .notify = acpi_button_notify, 91 .notify = acpi_button_notify,
91 }, 92 },
93 .drv.pm = &acpi_button_pm,
92}; 94};
93 95
94struct acpi_button { 96struct acpi_button {
@@ -308,8 +310,9 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
308 } 310 }
309} 311}
310 312
311static int acpi_button_resume(struct acpi_device *device) 313static int acpi_button_resume(struct device *dev)
312{ 314{
315 struct acpi_device *device = to_acpi_device(dev);
313 struct acpi_button *button = acpi_driver_data(device); 316 struct acpi_button *button = acpi_driver_data(device);
314 317
315 if (button->type == ACPI_BUTTON_TYPE_LID) 318 if (button->type == ACPI_BUTTON_TYPE_LID)