aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-27 17:27:25 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:02 -0400
commit4ce05b42603195386fa783c4f070ecc8682c189f (patch)
treeedc10f487e9cc23a5da8df64132aecbfa8fde840 /drivers/platform
parent43d2fd3b9d5be9be879179bec4f08c0c47d1ccd7 (diff)
hp_accel: Use struct dev_pm_ops for power management
Make the hp_accel 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> Reviewed-by: Éric Piel <eric.piel@tremplin-utc.net>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/hp_accel.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index c9e052033173..f4d91154ad67 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -353,20 +353,22 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
353 353
354 354
355#ifdef CONFIG_PM 355#ifdef CONFIG_PM
356static int lis3lv02d_suspend(struct acpi_device *device) 356static int lis3lv02d_suspend(struct device *dev)
357{ 357{
358 /* make sure the device is off when we suspend */ 358 /* make sure the device is off when we suspend */
359 lis3lv02d_poweroff(&lis3_dev); 359 lis3lv02d_poweroff(&lis3_dev);
360 return 0; 360 return 0;
361} 361}
362 362
363static int lis3lv02d_resume(struct acpi_device *device) 363static int lis3lv02d_resume(struct device *dev)
364{ 364{
365 return lis3lv02d_poweron(&lis3_dev); 365 return lis3lv02d_poweron(&lis3_dev);
366} 366}
367
368static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume);
369#define HP_ACCEL_PM (&hp_accel_pm)
367#else 370#else
368#define lis3lv02d_suspend NULL 371#define HP_ACCEL_PM NULL
369#define lis3lv02d_resume NULL
370#endif 372#endif
371 373
372/* For the HP MDPS aka 3D Driveguard */ 374/* For the HP MDPS aka 3D Driveguard */
@@ -377,9 +379,8 @@ static struct acpi_driver lis3lv02d_driver = {
377 .ops = { 379 .ops = {
378 .add = lis3lv02d_add, 380 .add = lis3lv02d_add,
379 .remove = lis3lv02d_remove, 381 .remove = lis3lv02d_remove,
380 .suspend = lis3lv02d_suspend, 382 },
381 .resume = lis3lv02d_resume, 383 .drv.pm = HP_ACCEL_PM,
382 }
383}; 384};
384 385
385static int __init lis3lv02d_init_module(void) 386static int __init lis3lv02d_init_module(void)