summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-29 23:40:13 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 13:31:06 +0200
commit13db85528fd606b2dfd8f1a5952158e4ad6ce51a (patch)
tree5aa6e694f86f02eb874a672db6f5d482eb867097 /drivers/acpi
parentc5dec0182256361a3f823316e8fb85263f76efe7 (diff)
downloadop-kernel-dev-13db85528fd606b2dfd8f1a5952158e4ad6ce51a.zip
op-kernel-dev-13db85528fd606b2dfd8f1a5952158e4ad6ce51a.tar.gz
ACPI / PM: Do not execute legacy driver PM callbacks
Since all ACPI drivers in the tree should have been switched to power management handling based on struct dev_pm_ops, modify the ACPI bus type driver so that is doesn't execute legacy driver power management callbacks from the functions pointed to by the members of the acpi_bus_pm structure. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/scan.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index af924ba..c384e59 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -290,51 +290,45 @@ static void acpi_device_release(struct device *dev)
kfree(acpi_dev);
}
-#define ACPI_DEV_PM_CALLBACK(dev, callback, legacy_cb) \
+#define ACPI_DEV_PM_CALLBACK(dev, callback) \
({ \
- struct acpi_device *__acpi_dev = to_acpi_device(dev); \
- struct acpi_driver *__acpi_drv = __acpi_dev->driver; \
struct device_driver *__drv = dev->driver; \
- int __ret; \
+ int __ret = 0; \
\
- if (__acpi_drv && __acpi_drv->ops.legacy_cb) \
- __ret = __acpi_drv->ops.legacy_cb(__acpi_dev); \
- else if (__drv && __drv->pm && __drv->pm->callback) \
+ if (__drv && __drv->pm && __drv->pm->callback) \
__ret = __drv->pm->callback(dev); \
- else \
- __ret = 0; \
\
__ret; \
})
static int acpi_pm_suspend(struct device *dev)
{
- return ACPI_DEV_PM_CALLBACK(dev, suspend, suspend);
+ return ACPI_DEV_PM_CALLBACK(dev, suspend);
}
static int acpi_pm_resume(struct device *dev)
{
- return ACPI_DEV_PM_CALLBACK(dev, resume, resume);
+ return ACPI_DEV_PM_CALLBACK(dev, resume);
}
static int acpi_pm_freeze(struct device *dev)
{
- return ACPI_DEV_PM_CALLBACK(dev, freeze, suspend);
+ return ACPI_DEV_PM_CALLBACK(dev, freeze);
}
static int acpi_pm_thaw(struct device *dev)
{
- return ACPI_DEV_PM_CALLBACK(dev, thaw, resume);
+ return ACPI_DEV_PM_CALLBACK(dev, thaw);
}
static int acpi_pm_poweroff(struct device *dev)
{
- return ACPI_DEV_PM_CALLBACK(dev, poweroff, suspend);
+ return ACPI_DEV_PM_CALLBACK(dev, poweroff);
}
static int acpi_pm_restore(struct device *dev)
{
- return ACPI_DEV_PM_CALLBACK(dev, restore, resume);
+ return ACPI_DEV_PM_CALLBACK(dev, restore);
}
static const struct dev_pm_ops acpi_bus_pm = {
OpenPOWER on IntegriCloud