aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-27 17:27:16 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:02 -0400
commit43d2fd3b9d5be9be879179bec4f08c0c47d1ccd7 (patch)
tree586c6ac03f8280289fb28ad65acb0976c8195384 /drivers/platform/x86
parentd202f77d2eb707d03a16adf952a397675cb2fc81 (diff)
toshiba_acpi: Use struct dev_pm_ops for power management
Make the toshiba_acpi 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>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/toshiba_acpi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index fd90b6da0a4b..c13ba5bac93f 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1296,9 +1296,9 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
1296 } 1296 }
1297} 1297}
1298 1298
1299static int toshiba_acpi_suspend(struct acpi_device *acpi_dev) 1299static int toshiba_acpi_suspend(struct device *device)
1300{ 1300{
1301 struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev); 1301 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
1302 u32 result; 1302 u32 result;
1303 1303
1304 if (dev->hotkey_dev) 1304 if (dev->hotkey_dev)
@@ -1307,9 +1307,9 @@ static int toshiba_acpi_suspend(struct acpi_device *acpi_dev)
1307 return 0; 1307 return 0;
1308} 1308}
1309 1309
1310static int toshiba_acpi_resume(struct acpi_device *acpi_dev) 1310static int toshiba_acpi_resume(struct device *device)
1311{ 1311{
1312 struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev); 1312 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
1313 u32 result; 1313 u32 result;
1314 1314
1315 if (dev->hotkey_dev) 1315 if (dev->hotkey_dev)
@@ -1318,6 +1318,9 @@ static int toshiba_acpi_resume(struct acpi_device *acpi_dev)
1318 return 0; 1318 return 0;
1319} 1319}
1320 1320
1321static SIMPLE_DEV_PM_OPS(toshiba_acpi_pm,
1322 toshiba_acpi_suspend, toshiba_acpi_resume);
1323
1321static struct acpi_driver toshiba_acpi_driver = { 1324static struct acpi_driver toshiba_acpi_driver = {
1322 .name = "Toshiba ACPI driver", 1325 .name = "Toshiba ACPI driver",
1323 .owner = THIS_MODULE, 1326 .owner = THIS_MODULE,
@@ -1327,9 +1330,8 @@ static struct acpi_driver toshiba_acpi_driver = {
1327 .add = toshiba_acpi_add, 1330 .add = toshiba_acpi_add,
1328 .remove = toshiba_acpi_remove, 1331 .remove = toshiba_acpi_remove,
1329 .notify = toshiba_acpi_notify, 1332 .notify = toshiba_acpi_notify,
1330 .suspend = toshiba_acpi_suspend,
1331 .resume = toshiba_acpi_resume,
1332 }, 1333 },
1334 .drv.pm = &toshiba_acpi_pm,
1333}; 1335};
1334 1336
1335static int __init toshiba_acpi_init(void) 1337static int __init toshiba_acpi_init(void)