aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 15:33:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 15:33:19 -0500
commit288f02bbb6e9609cbaf1eb7a9cb97ae45ce090b2 (patch)
tree4f5e5c9fe6638bdbd246379f64b3541de68f329a /drivers/pnp
parent8aedf8a6ae98d5d4df3254b6afb7e4432d9d8600 (diff)
parentaa96ce0af8385415a3450bc13e6254a4d6b4a888 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (117 commits) ACPI processor: Fix section mismatch for processor_add() ACPI: Add platform-wide _OSC support. ACPI: cleanup pci_root _OSC code. ACPI: Add a generic API for _OSC -v2 msi-wmi: depend on backlight and fix corner-cases problems msi-wmi: switch to using input sparse keymap library msi-wmi: replace one-condition switch-case with if statement msi-wmi: remove unused field 'instance' in key_entry structure msi-wmi: remove custom runtime debug implementation msi-wmi: rework init msi-wmi: remove useless includes X86 drivers: Introduce msi-wmi driver Toshiba Bluetooth Enabling driver (RFKill handler v3) ACPI: fix for lapic_timer_propagate_broadcast() acpi_pad: squish warning ACPI: dock: minor whitespace and style cleanups ACPI: dock: add struct dock_station * directly to platform device data ACPI: dock: dock_add - hoist up platform_device_register_simple() ACPI: dock: remove global 'dock_device_name' ACPI: dock: combine add|alloc_dock_dependent_device (v2) ...
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpacpi/core.c20
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c9
2 files changed, 20 insertions, 9 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 83b8b5ac49c9..5314bf630bc4 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -80,7 +80,8 @@ static int pnpacpi_get_resources(struct pnp_dev *dev)
80 80
81static int pnpacpi_set_resources(struct pnp_dev *dev) 81static int pnpacpi_set_resources(struct pnp_dev *dev)
82{ 82{
83 acpi_handle handle = dev->data; 83 struct acpi_device *acpi_dev = dev->data;
84 acpi_handle handle = acpi_dev->handle;
84 struct acpi_buffer buffer; 85 struct acpi_buffer buffer;
85 int ret; 86 int ret;
86 87
@@ -103,7 +104,8 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
103 104
104static int pnpacpi_disable_resources(struct pnp_dev *dev) 105static int pnpacpi_disable_resources(struct pnp_dev *dev)
105{ 106{
106 acpi_handle handle = dev->data; 107 struct acpi_device *acpi_dev = dev->data;
108 acpi_handle handle = acpi_dev->handle;
107 int ret; 109 int ret;
108 110
109 dev_dbg(&dev->dev, "disable resources\n"); 111 dev_dbg(&dev->dev, "disable resources\n");
@@ -121,6 +123,8 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev)
121#ifdef CONFIG_ACPI_SLEEP 123#ifdef CONFIG_ACPI_SLEEP
122static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) 124static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state)
123{ 125{
126 struct acpi_device *acpi_dev = dev->data;
127 acpi_handle handle = acpi_dev->handle;
124 int power_state; 128 int power_state;
125 129
126 power_state = acpi_pm_device_sleep_state(&dev->dev, NULL); 130 power_state = acpi_pm_device_sleep_state(&dev->dev, NULL);
@@ -128,16 +132,19 @@ static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state)
128 power_state = (state.event == PM_EVENT_ON) ? 132 power_state = (state.event == PM_EVENT_ON) ?
129 ACPI_STATE_D0 : ACPI_STATE_D3; 133 ACPI_STATE_D0 : ACPI_STATE_D3;
130 134
131 return acpi_bus_set_power((acpi_handle) dev->data, power_state); 135 return acpi_bus_set_power(handle, power_state);
132} 136}
133 137
134static int pnpacpi_resume(struct pnp_dev *dev) 138static int pnpacpi_resume(struct pnp_dev *dev)
135{ 139{
136 return acpi_bus_set_power((acpi_handle) dev->data, ACPI_STATE_D0); 140 struct acpi_device *acpi_dev = dev->data;
141 acpi_handle handle = acpi_dev->handle;
142
143 return acpi_bus_set_power(handle, ACPI_STATE_D0);
137} 144}
138#endif 145#endif
139 146
140static struct pnp_protocol pnpacpi_protocol = { 147struct pnp_protocol pnpacpi_protocol = {
141 .name = "Plug and Play ACPI", 148 .name = "Plug and Play ACPI",
142 .get = pnpacpi_get_resources, 149 .get = pnpacpi_get_resources,
143 .set = pnpacpi_set_resources, 150 .set = pnpacpi_set_resources,
@@ -147,6 +154,7 @@ static struct pnp_protocol pnpacpi_protocol = {
147 .resume = pnpacpi_resume, 154 .resume = pnpacpi_resume,
148#endif 155#endif
149}; 156};
157EXPORT_SYMBOL(pnpacpi_protocol);
150 158
151static int __init pnpacpi_add_device(struct acpi_device *device) 159static int __init pnpacpi_add_device(struct acpi_device *device)
152{ 160{
@@ -168,7 +176,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
168 if (!dev) 176 if (!dev)
169 return -ENOMEM; 177 return -ENOMEM;
170 178
171 dev->data = device->handle; 179 dev->data = device;
172 /* .enabled means the device can decode the resources */ 180 /* .enabled means the device can decode the resources */
173 dev->active = device->status.enabled; 181 dev->active = device->status.enabled;
174 status = acpi_get_handle(device->handle, "_SRS", &temp); 182 status = acpi_get_handle(device->handle, "_SRS", &temp);
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index ef3a2cd3a7a0..5702b2c8691f 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -465,7 +465,8 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
465 465
466int pnpacpi_parse_allocated_resource(struct pnp_dev *dev) 466int pnpacpi_parse_allocated_resource(struct pnp_dev *dev)
467{ 467{
468 acpi_handle handle = dev->data; 468 struct acpi_device *acpi_dev = dev->data;
469 acpi_handle handle = acpi_dev->handle;
469 acpi_status status; 470 acpi_status status;
470 471
471 pnp_dbg(&dev->dev, "parse allocated resources\n"); 472 pnp_dbg(&dev->dev, "parse allocated resources\n");
@@ -773,7 +774,8 @@ static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res,
773 774
774int __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev) 775int __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev)
775{ 776{
776 acpi_handle handle = dev->data; 777 struct acpi_device *acpi_dev = dev->data;
778 acpi_handle handle = acpi_dev->handle;
777 acpi_status status; 779 acpi_status status;
778 struct acpipnp_parse_option_s parse_data; 780 struct acpipnp_parse_option_s parse_data;
779 781
@@ -845,7 +847,8 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data)
845int pnpacpi_build_resource_template(struct pnp_dev *dev, 847int pnpacpi_build_resource_template(struct pnp_dev *dev,
846 struct acpi_buffer *buffer) 848 struct acpi_buffer *buffer)
847{ 849{
848 acpi_handle handle = dev->data; 850 struct acpi_device *acpi_dev = dev->data;
851 acpi_handle handle = acpi_dev->handle;
849 struct acpi_resource *resource; 852 struct acpi_resource *resource;
850 int res_cnt = 0; 853 int res_cnt = 0;
851 acpi_status status; 854 acpi_status status;