aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r--drivers/acpi/power.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index dd6d6a3c6780..894d45c6bc67 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -60,7 +60,6 @@ ACPI_MODULE_NAME("power");
60 60
61static int acpi_power_add(struct acpi_device *device); 61static int acpi_power_add(struct acpi_device *device);
62static int acpi_power_remove(struct acpi_device *device, int type); 62static int acpi_power_remove(struct acpi_device *device, int type);
63static int acpi_power_resume(struct acpi_device *device);
64 63
65static const struct acpi_device_id power_device_ids[] = { 64static const struct acpi_device_id power_device_ids[] = {
66 {ACPI_POWER_HID, 0}, 65 {ACPI_POWER_HID, 0},
@@ -68,6 +67,9 @@ static const struct acpi_device_id power_device_ids[] = {
68}; 67};
69MODULE_DEVICE_TABLE(acpi, power_device_ids); 68MODULE_DEVICE_TABLE(acpi, power_device_ids);
70 69
70static int acpi_power_resume(struct device *dev);
71static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume);
72
71static struct acpi_driver acpi_power_driver = { 73static struct acpi_driver acpi_power_driver = {
72 .name = "power", 74 .name = "power",
73 .class = ACPI_POWER_CLASS, 75 .class = ACPI_POWER_CLASS,
@@ -75,8 +77,8 @@ static struct acpi_driver acpi_power_driver = {
75 .ops = { 77 .ops = {
76 .add = acpi_power_add, 78 .add = acpi_power_add,
77 .remove = acpi_power_remove, 79 .remove = acpi_power_remove,
78 .resume = acpi_power_resume,
79 }, 80 },
81 .drv.pm = &acpi_power_pm,
80}; 82};
81 83
82/* 84/*
@@ -771,14 +773,16 @@ static int acpi_power_remove(struct acpi_device *device, int type)
771 return 0; 773 return 0;
772} 774}
773 775
774static int acpi_power_resume(struct acpi_device *device) 776static int acpi_power_resume(struct device *dev)
775{ 777{
776 int result = 0, state; 778 int result = 0, state;
779 struct acpi_device *device;
777 struct acpi_power_resource *resource; 780 struct acpi_power_resource *resource;
778 781
779 if (!device) 782 if (!dev)
780 return -EINVAL; 783 return -EINVAL;
781 784
785 device = to_acpi_device(dev);
782 resource = acpi_driver_data(device); 786 resource = acpi_driver_data(device);
783 if (!resource) 787 if (!resource)
784 return -EINVAL; 788 return -EINVAL;