aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-27 17:27:07 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:01 -0400
commitd202f77d2eb707d03a16adf952a397675cb2fc81 (patch)
treeec175e2d633ce98e76073b4e116037fdf60c866e /drivers/acpi
parente579e2dd8f056cfeaf4d2b313a35ddafb3c4e531 (diff)
ACPI: Use struct dev_pm_ops for power management in the SBS driver
Make the ACPI Smart Battery System 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/acpi')
-rw-r--r--drivers/acpi/sbs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 6e36d0c0057c..c0b9aa5faf4c 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -988,16 +988,18 @@ static void acpi_sbs_rmdirs(void)
988#endif 988#endif
989} 989}
990 990
991static int acpi_sbs_resume(struct acpi_device *device) 991static int acpi_sbs_resume(struct device *dev)
992{ 992{
993 struct acpi_sbs *sbs; 993 struct acpi_sbs *sbs;
994 if (!device) 994 if (!dev)
995 return -EINVAL; 995 return -EINVAL;
996 sbs = device->driver_data; 996 sbs = to_acpi_device(dev)->driver_data;
997 acpi_sbs_callback(sbs); 997 acpi_sbs_callback(sbs);
998 return 0; 998 return 0;
999} 999}
1000 1000
1001static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);
1002
1001static struct acpi_driver acpi_sbs_driver = { 1003static struct acpi_driver acpi_sbs_driver = {
1002 .name = "sbs", 1004 .name = "sbs",
1003 .class = ACPI_SBS_CLASS, 1005 .class = ACPI_SBS_CLASS,
@@ -1005,8 +1007,8 @@ static struct acpi_driver acpi_sbs_driver = {
1005 .ops = { 1007 .ops = {
1006 .add = acpi_sbs_add, 1008 .add = acpi_sbs_add,
1007 .remove = acpi_sbs_remove, 1009 .remove = acpi_sbs_remove,
1008 .resume = acpi_sbs_resume,
1009 }, 1010 },
1011 .drv.pm = &acpi_sbs_pm,
1010}; 1012};
1011 1013
1012static int __init acpi_sbs_init(void) 1014static int __init acpi_sbs_init(void)