aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-29 17:40:29 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:06 -0400
commitd91ee328c1e8b3992ffbf84a1a984c2a7f4ebff7 (patch)
treed7974c41b4e608ce8aa0152489396f063250500f /drivers/acpi
parenta5cd33e1d4f3319e86f9f0fc667fa74ef9d9216c (diff)
ACPI / PM: Drop PM callbacks from the ACPI bus type
Since the ACPI bus type's PM callbacks only execute the driver ones without doing anything else, they can be dropped, because the driver callbacks will be executed by the PM core directly if bus type (or other subsystem) callbacks are not present. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/scan.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index c384e59c3d9a..fdda49336560 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -290,56 +290,6 @@ static void acpi_device_release(struct device *dev)
290 kfree(acpi_dev); 290 kfree(acpi_dev);
291} 291}
292 292
293#define ACPI_DEV_PM_CALLBACK(dev, callback) \
294({ \
295 struct device_driver *__drv = dev->driver; \
296 int __ret = 0; \
297 \
298 if (__drv && __drv->pm && __drv->pm->callback) \
299 __ret = __drv->pm->callback(dev); \
300 \
301 __ret; \
302})
303
304static int acpi_pm_suspend(struct device *dev)
305{
306 return ACPI_DEV_PM_CALLBACK(dev, suspend);
307}
308
309static int acpi_pm_resume(struct device *dev)
310{
311 return ACPI_DEV_PM_CALLBACK(dev, resume);
312}
313
314static int acpi_pm_freeze(struct device *dev)
315{
316 return ACPI_DEV_PM_CALLBACK(dev, freeze);
317}
318
319static int acpi_pm_thaw(struct device *dev)
320{
321 return ACPI_DEV_PM_CALLBACK(dev, thaw);
322}
323
324static int acpi_pm_poweroff(struct device *dev)
325{
326 return ACPI_DEV_PM_CALLBACK(dev, poweroff);
327}
328
329static int acpi_pm_restore(struct device *dev)
330{
331 return ACPI_DEV_PM_CALLBACK(dev, restore);
332}
333
334static const struct dev_pm_ops acpi_bus_pm = {
335 .suspend = acpi_pm_suspend,
336 .resume = acpi_pm_resume,
337 .freeze = acpi_pm_freeze,
338 .thaw = acpi_pm_thaw,
339 .poweroff = acpi_pm_poweroff,
340 .restore = acpi_pm_restore,
341};
342
343static int acpi_bus_match(struct device *dev, struct device_driver *drv) 293static int acpi_bus_match(struct device *dev, struct device_driver *drv)
344{ 294{
345 struct acpi_device *acpi_dev = to_acpi_device(dev); 295 struct acpi_device *acpi_dev = to_acpi_device(dev);
@@ -475,7 +425,6 @@ struct bus_type acpi_bus_type = {
475 .probe = acpi_device_probe, 425 .probe = acpi_device_probe,
476 .remove = acpi_device_remove, 426 .remove = acpi_device_remove,
477 .uevent = acpi_device_uevent, 427 .uevent = acpi_device_uevent,
478 .pm = &acpi_bus_pm,
479}; 428};
480 429
481static int acpi_device_register(struct acpi_device *device) 430static int acpi_device_register(struct acpi_device *device)