summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/classmate-laptop.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-29 23:39:48 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 13:31:05 +0200
commit81bc495401955bf7a62d04f8c794718476a2b093 (patch)
treea64abb9934247ff1ffa13424ebbeb84c15ba8bbe /drivers/platform/x86/classmate-laptop.c
parentxo15-ebook: Use struct dev_pm_ops for power management (diff)
downloadlinux-81bc495401955bf7a62d04f8c794718476a2b093.tar.xz
linux-81bc495401955bf7a62d04f8c794718476a2b093.zip
classmate-laptop: Use struct dev_pm_ops for power management
Make the classmate-laptop 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> Acked-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Diffstat (limited to 'drivers/platform/x86/classmate-laptop.c')
-rw-r--r--drivers/platform/x86/classmate-laptop.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 94f93b621d7b..e2230a2b2f8e 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -362,15 +362,18 @@ static int cmpc_tablet_remove(struct acpi_device *acpi, int type)
return cmpc_remove_acpi_notify_device(acpi);
}
-static int cmpc_tablet_resume(struct acpi_device *acpi)
+static int cmpc_tablet_resume(struct device *dev)
{
- struct input_dev *inputdev = dev_get_drvdata(&acpi->dev);
+ struct input_dev *inputdev = dev_get_drvdata(dev);
+
unsigned long long val = 0;
- if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val)))
+ if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val)))
input_report_switch(inputdev, SW_TABLET_MODE, !val);
return 0;
}
+static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume);
+
static const struct acpi_device_id cmpc_tablet_device_ids[] = {
{CMPC_TABLET_HID, 0},
{"", 0}
@@ -384,9 +387,9 @@ static struct acpi_driver cmpc_tablet_acpi_driver = {
.ops = {
.add = cmpc_tablet_add,
.remove = cmpc_tablet_remove,
- .resume = cmpc_tablet_resume,
.notify = cmpc_tablet_handler,
- }
+ },
+ .drv.pm = &cmpc_tablet_pm,
};