Commit 4959a781 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

thinkpad_acpi: Use struct dev_pm_ops instead of legacy PM routines

Make the thinkpad_acpi driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: default avatarMatthew Garrett <mjg@redhat.com>
parent fd3c3a42
...@@ -922,8 +922,7 @@ static struct input_dev *tpacpi_inputdev; ...@@ -922,8 +922,7 @@ static struct input_dev *tpacpi_inputdev;
static struct mutex tpacpi_inputdev_send_mutex; static struct mutex tpacpi_inputdev_send_mutex;
static LIST_HEAD(tpacpi_all_drivers); static LIST_HEAD(tpacpi_all_drivers);
static int tpacpi_suspend_handler(struct platform_device *pdev, static int tpacpi_suspend_handler(struct device *dev)
pm_message_t state)
{ {
struct ibm_struct *ibm, *itmp; struct ibm_struct *ibm, *itmp;
...@@ -937,7 +936,7 @@ static int tpacpi_suspend_handler(struct platform_device *pdev, ...@@ -937,7 +936,7 @@ static int tpacpi_suspend_handler(struct platform_device *pdev,
return 0; return 0;
} }
static int tpacpi_resume_handler(struct platform_device *pdev) static int tpacpi_resume_handler(struct device *dev)
{ {
struct ibm_struct *ibm, *itmp; struct ibm_struct *ibm, *itmp;
...@@ -951,6 +950,9 @@ static int tpacpi_resume_handler(struct platform_device *pdev) ...@@ -951,6 +950,9 @@ static int tpacpi_resume_handler(struct platform_device *pdev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(tpacpi_pm,
tpacpi_suspend_handler, tpacpi_resume_handler);
static void tpacpi_shutdown_handler(struct platform_device *pdev) static void tpacpi_shutdown_handler(struct platform_device *pdev)
{ {
struct ibm_struct *ibm, *itmp; struct ibm_struct *ibm, *itmp;
...@@ -967,9 +969,8 @@ static struct platform_driver tpacpi_pdriver = { ...@@ -967,9 +969,8 @@ static struct platform_driver tpacpi_pdriver = {
.driver = { .driver = {
.name = TPACPI_DRVR_NAME, .name = TPACPI_DRVR_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &tpacpi_pm,
}, },
.suspend = tpacpi_suspend_handler,
.resume = tpacpi_resume_handler,
.shutdown = tpacpi_shutdown_handler, .shutdown = tpacpi_shutdown_handler,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment