Skip to content

Commit

Permalink
ACPI: Use struct dev_pm_ops for power management in the SBS driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rafael J. Wysocki committed Jul 1, 2012
1 parent e579e2d commit d202f77
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/acpi/sbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,25 +988,27 @@ static void acpi_sbs_rmdirs(void)
#endif
}

static int acpi_sbs_resume(struct acpi_device *device)
static int acpi_sbs_resume(struct device *dev)
{
struct acpi_sbs *sbs;
if (!device)
if (!dev)
return -EINVAL;
sbs = device->driver_data;
sbs = to_acpi_device(dev)->driver_data;
acpi_sbs_callback(sbs);
return 0;
}

static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);

static struct acpi_driver acpi_sbs_driver = {
.name = "sbs",
.class = ACPI_SBS_CLASS,
.ids = sbs_device_ids,
.ops = {
.add = acpi_sbs_add,
.remove = acpi_sbs_remove,
.resume = acpi_sbs_resume,
},
.drv.pm = &acpi_sbs_pm,
};

static int __init acpi_sbs_init(void)
Expand Down

0 comments on commit d202f77

Please sign in to comment.