Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 707156e6 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

ACPI / PM: Make acpi_bus_type use struct dev_pm_ops for PM handling



Make the acpi_bus_type bus type define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct bus_type.

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 17621e11
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -290,7 +290,7 @@ static void acpi_device_release(struct device *dev)
	kfree(acpi_dev);
	kfree(acpi_dev);
}
}


static int acpi_device_suspend(struct device *dev, pm_message_t state)
static int acpi_device_suspend(struct device *dev)
{
{
	struct acpi_device *acpi_dev = to_acpi_device(dev);
	struct acpi_device *acpi_dev = to_acpi_device(dev);
	struct acpi_driver *acpi_drv = acpi_dev->driver;
	struct acpi_driver *acpi_drv = acpi_dev->driver;
@@ -310,6 +310,8 @@ static int acpi_device_resume(struct device *dev)
	return 0;
	return 0;
}
}


static SIMPLE_DEV_PM_OPS(acpi_bus_pm, acpi_device_suspend, acpi_device_resume);

static int acpi_bus_match(struct device *dev, struct device_driver *drv)
static int acpi_bus_match(struct device *dev, struct device_driver *drv)
{
{
	struct acpi_device *acpi_dev = to_acpi_device(dev);
	struct acpi_device *acpi_dev = to_acpi_device(dev);
@@ -441,12 +443,11 @@ static int acpi_device_remove(struct device * dev)


struct bus_type acpi_bus_type = {
struct bus_type acpi_bus_type = {
	.name		= "acpi",
	.name		= "acpi",
	.suspend	= acpi_device_suspend,
	.resume		= acpi_device_resume,
	.match		= acpi_bus_match,
	.match		= acpi_bus_match,
	.probe		= acpi_device_probe,
	.probe		= acpi_device_probe,
	.remove		= acpi_device_remove,
	.remove		= acpi_device_remove,
	.uevent		= acpi_device_uevent,
	.uevent		= acpi_device_uevent,
	.pm		= &acpi_bus_pm,
};
};


static int acpi_device_register(struct acpi_device *device)
static int acpi_device_register(struct acpi_device *device)