Skip to content

Commit

Permalink
acer-wmi: Use struct dev_pm_ops for power management
Browse files Browse the repository at this point in the history
Make the acer-wmi 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: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Lee, Chun-Yi <jlee@suse.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
Rafael J. Wysocki committed Jul 1, 2012
1 parent 818e148 commit 3c33be0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/platform/x86/acer-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,8 +1877,7 @@ static int acer_platform_remove(struct platform_device *device)
return 0;
}

static int acer_platform_suspend(struct platform_device *dev,
pm_message_t state)
static int acer_suspend(struct device *dev)
{
u32 value;
struct acer_data *data = &interface->data;
Expand All @@ -1900,7 +1899,7 @@ pm_message_t state)
return 0;
}

static int acer_platform_resume(struct platform_device *device)
static int acer_resume(struct device *dev)
{
struct acer_data *data = &interface->data;

Expand All @@ -1916,6 +1915,8 @@ static int acer_platform_resume(struct platform_device *device)
return 0;
}

static SIMPLE_DEV_PM_OPS(acer_pm, acer_suspend, acer_resume);

static void acer_platform_shutdown(struct platform_device *device)
{
struct acer_data *data = &interface->data;
Expand All @@ -1931,11 +1932,10 @@ static struct platform_driver acer_platform_driver = {
.driver = {
.name = "acer-wmi",
.owner = THIS_MODULE,
.pm = &acer_pm,
},
.probe = acer_platform_probe,
.remove = acer_platform_remove,
.suspend = acer_platform_suspend,
.resume = acer_platform_resume,
.shutdown = acer_platform_shutdown,
};

Expand Down

0 comments on commit 3c33be0

Please sign in to comment.