Commit d202f77d authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

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: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent e579e2dd
...@@ -988,16 +988,18 @@ static void acpi_sbs_rmdirs(void) ...@@ -988,16 +988,18 @@ static void acpi_sbs_rmdirs(void)
#endif #endif
} }
static int acpi_sbs_resume(struct acpi_device *device) static int acpi_sbs_resume(struct device *dev)
{ {
struct acpi_sbs *sbs; struct acpi_sbs *sbs;
if (!device) if (!dev)
return -EINVAL; return -EINVAL;
sbs = device->driver_data; sbs = to_acpi_device(dev)->driver_data;
acpi_sbs_callback(sbs); acpi_sbs_callback(sbs);
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);
static struct acpi_driver acpi_sbs_driver = { static struct acpi_driver acpi_sbs_driver = {
.name = "sbs", .name = "sbs",
.class = ACPI_SBS_CLASS, .class = ACPI_SBS_CLASS,
...@@ -1005,8 +1007,8 @@ static struct acpi_driver acpi_sbs_driver = { ...@@ -1005,8 +1007,8 @@ static struct acpi_driver acpi_sbs_driver = {
.ops = { .ops = {
.add = acpi_sbs_add, .add = acpi_sbs_add,
.remove = acpi_sbs_remove, .remove = acpi_sbs_remove,
.resume = acpi_sbs_resume,
}, },
.drv.pm = &acpi_sbs_pm,
}; };
static int __init acpi_sbs_init(void) static int __init acpi_sbs_init(void)
......
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