aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-29 17:39:48 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:05 -0400
commit81bc495401955bf7a62d04f8c794718476a2b093 (patch)
treea64abb9934247ff1ffa13424ebbeb84c15ba8bbe /drivers
parent44cb98c48e19f506e178c519f5da2c23a156e002 (diff)
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')
-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)
362 return cmpc_remove_acpi_notify_device(acpi); 362 return cmpc_remove_acpi_notify_device(acpi);
363} 363}
364 364
365static int cmpc_tablet_resume(struct acpi_device *acpi) 365static int cmpc_tablet_resume(struct device *dev)
366{ 366{
367 struct input_dev *inputdev = dev_get_drvdata(&acpi->dev); 367 struct input_dev *inputdev = dev_get_drvdata(dev);
368
368 unsigned long long val = 0; 369 unsigned long long val = 0;
369 if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) 370 if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val)))
370 input_report_switch(inputdev, SW_TABLET_MODE, !val); 371 input_report_switch(inputdev, SW_TABLET_MODE, !val);
371 return 0; 372 return 0;
372} 373}
373 374
375static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume);
376
374static const struct acpi_device_id cmpc_tablet_device_ids[] = { 377static const struct acpi_device_id cmpc_tablet_device_ids[] = {
375 {CMPC_TABLET_HID, 0}, 378 {CMPC_TABLET_HID, 0},
376 {"", 0} 379 {"", 0}
@@ -384,9 +387,9 @@ static struct acpi_driver cmpc_tablet_acpi_driver = {
384 .ops = { 387 .ops = {
385 .add = cmpc_tablet_add, 388 .add = cmpc_tablet_add,
386 .remove = cmpc_tablet_remove, 389 .remove = cmpc_tablet_remove,
387 .resume = cmpc_tablet_resume,
388 .notify = cmpc_tablet_handler, 390 .notify = cmpc_tablet_handler,
389 } 391 },
392 .drv.pm = &cmpc_tablet_pm,
390}; 393};
391 394
392 395