diff options
author | Len Brown <len.brown@intel.com> | 2006-07-01 11:05:19 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-07-01 11:05:19 -0400 |
commit | b2f71bade430d468398167d696731bf770de2db8 (patch) | |
tree | b804b0b21e722a42d5f2ee5edead8cab2e41be8b | |
parent | ba290ab7dace8b3339c0cc86c221d48eed21e956 (diff) | |
parent | d07a8577f695c807977af003b6e75f996e01a15f (diff) |
Pull acpi_device_handle_cleanup into release branch
-rw-r--r-- | drivers/acpi/ac.c | 14 | ||||
-rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 14 | ||||
-rw-r--r-- | drivers/acpi/battery.c | 23 | ||||
-rw-r--r-- | drivers/acpi/button.c | 10 | ||||
-rw-r--r-- | drivers/acpi/fan.c | 10 | ||||
-rw-r--r-- | drivers/acpi/pci_link.c | 15 | ||||
-rw-r--r-- | drivers/acpi/pci_root.c | 20 | ||||
-rw-r--r-- | drivers/acpi/power.c | 22 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 57 | ||||
-rw-r--r-- | drivers/acpi/video.c | 74 |
10 files changed, 111 insertions, 148 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 36ca365bcead..4537ae4838c4 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
@@ -65,7 +65,7 @@ static struct acpi_driver acpi_ac_driver = { | |||
65 | }; | 65 | }; |
66 | 66 | ||
67 | struct acpi_ac { | 67 | struct acpi_ac { |
68 | acpi_handle handle; | 68 | struct acpi_device * device; |
69 | unsigned long state; | 69 | unsigned long state; |
70 | }; | 70 | }; |
71 | 71 | ||
@@ -88,7 +88,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac) | |||
88 | if (!ac) | 88 | if (!ac) |
89 | return -EINVAL; | 89 | return -EINVAL; |
90 | 90 | ||
91 | status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state); | 91 | status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state); |
92 | if (ACPI_FAILURE(status)) { | 92 | if (ACPI_FAILURE(status)) { |
93 | ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); | 93 | ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); |
94 | ac->state = ACPI_AC_STATUS_UNKNOWN; | 94 | ac->state = ACPI_AC_STATUS_UNKNOWN; |
@@ -191,9 +191,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) | |||
191 | if (!ac) | 191 | if (!ac) |
192 | return; | 192 | return; |
193 | 193 | ||
194 | if (acpi_bus_get_device(ac->handle, &device)) | 194 | device = ac->device; |
195 | return; | ||
196 | |||
197 | switch (event) { | 195 | switch (event) { |
198 | case ACPI_AC_NOTIFY_STATUS: | 196 | case ACPI_AC_NOTIFY_STATUS: |
199 | acpi_ac_get_state(ac); | 197 | acpi_ac_get_state(ac); |
@@ -223,7 +221,7 @@ static int acpi_ac_add(struct acpi_device *device) | |||
223 | return -ENOMEM; | 221 | return -ENOMEM; |
224 | memset(ac, 0, sizeof(struct acpi_ac)); | 222 | memset(ac, 0, sizeof(struct acpi_ac)); |
225 | 223 | ||
226 | ac->handle = device->handle; | 224 | ac->device = device; |
227 | strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); | 225 | strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); |
228 | strcpy(acpi_device_class(device), ACPI_AC_CLASS); | 226 | strcpy(acpi_device_class(device), ACPI_AC_CLASS); |
229 | acpi_driver_data(device) = ac; | 227 | acpi_driver_data(device) = ac; |
@@ -236,7 +234,7 @@ static int acpi_ac_add(struct acpi_device *device) | |||
236 | if (result) | 234 | if (result) |
237 | goto end; | 235 | goto end; |
238 | 236 | ||
239 | status = acpi_install_notify_handler(ac->handle, | 237 | status = acpi_install_notify_handler(device->handle, |
240 | ACPI_DEVICE_NOTIFY, acpi_ac_notify, | 238 | ACPI_DEVICE_NOTIFY, acpi_ac_notify, |
241 | ac); | 239 | ac); |
242 | if (ACPI_FAILURE(status)) { | 240 | if (ACPI_FAILURE(status)) { |
@@ -268,7 +266,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type) | |||
268 | 266 | ||
269 | ac = (struct acpi_ac *)acpi_driver_data(device); | 267 | ac = (struct acpi_ac *)acpi_driver_data(device); |
270 | 268 | ||
271 | status = acpi_remove_notify_handler(ac->handle, | 269 | status = acpi_remove_notify_handler(device->handle, |
272 | ACPI_DEVICE_NOTIFY, acpi_ac_notify); | 270 | ACPI_DEVICE_NOTIFY, acpi_ac_notify); |
273 | 271 | ||
274 | acpi_ac_remove_fs(device); | 272 | acpi_ac_remove_fs(device); |
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 84a68965c11a..81e970adeab3 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -80,7 +80,7 @@ struct acpi_memory_info { | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | struct acpi_memory_device { | 82 | struct acpi_memory_device { |
83 | acpi_handle handle; | 83 | struct acpi_device * device; |
84 | unsigned int state; /* State of the memory device */ | 84 | unsigned int state; /* State of the memory device */ |
85 | struct list_head res_list; | 85 | struct list_head res_list; |
86 | }; | 86 | }; |
@@ -129,7 +129,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) | |||
129 | struct acpi_memory_info *info, *n; | 129 | struct acpi_memory_info *info, *n; |
130 | 130 | ||
131 | 131 | ||
132 | status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS, | 132 | status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS, |
133 | acpi_memory_get_resource, mem_device); | 133 | acpi_memory_get_resource, mem_device); |
134 | if (ACPI_FAILURE(status)) { | 134 | if (ACPI_FAILURE(status)) { |
135 | list_for_each_entry_safe(info, n, &mem_device->res_list, list) | 135 | list_for_each_entry_safe(info, n, &mem_device->res_list, list) |
@@ -192,7 +192,7 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device) | |||
192 | 192 | ||
193 | 193 | ||
194 | /* Get device present/absent information from the _STA */ | 194 | /* Get device present/absent information from the _STA */ |
195 | if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA", | 195 | if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA", |
196 | NULL, ¤t_status))) | 196 | NULL, ¤t_status))) |
197 | return -ENODEV; | 197 | return -ENODEV; |
198 | /* | 198 | /* |
@@ -222,7 +222,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) | |||
222 | return result; | 222 | return result; |
223 | } | 223 | } |
224 | 224 | ||
225 | node = acpi_get_node(mem_device->handle); | 225 | node = acpi_get_node(mem_device->device->handle); |
226 | /* | 226 | /* |
227 | * Tell the VM there is more memory here... | 227 | * Tell the VM there is more memory here... |
228 | * Note: Assume that this function returns zero on success | 228 | * Note: Assume that this function returns zero on success |
@@ -269,7 +269,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) | |||
269 | arg_list.pointer = &arg; | 269 | arg_list.pointer = &arg; |
270 | arg.type = ACPI_TYPE_INTEGER; | 270 | arg.type = ACPI_TYPE_INTEGER; |
271 | arg.integer.value = 1; | 271 | arg.integer.value = 1; |
272 | status = acpi_evaluate_object(mem_device->handle, | 272 | status = acpi_evaluate_object(mem_device->device->handle, |
273 | "_EJ0", &arg_list, NULL); | 273 | "_EJ0", &arg_list, NULL); |
274 | /* Return on _EJ0 failure */ | 274 | /* Return on _EJ0 failure */ |
275 | if (ACPI_FAILURE(status)) { | 275 | if (ACPI_FAILURE(status)) { |
@@ -278,7 +278,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) | |||
278 | } | 278 | } |
279 | 279 | ||
280 | /* Evalute _STA to check if the device is disabled */ | 280 | /* Evalute _STA to check if the device is disabled */ |
281 | status = acpi_evaluate_integer(mem_device->handle, "_STA", | 281 | status = acpi_evaluate_integer(mem_device->device->handle, "_STA", |
282 | NULL, ¤t_status); | 282 | NULL, ¤t_status); |
283 | if (ACPI_FAILURE(status)) | 283 | if (ACPI_FAILURE(status)) |
284 | return -ENODEV; | 284 | return -ENODEV; |
@@ -398,7 +398,7 @@ static int acpi_memory_device_add(struct acpi_device *device) | |||
398 | memset(mem_device, 0, sizeof(struct acpi_memory_device)); | 398 | memset(mem_device, 0, sizeof(struct acpi_memory_device)); |
399 | 399 | ||
400 | INIT_LIST_HEAD(&mem_device->res_list); | 400 | INIT_LIST_HEAD(&mem_device->res_list); |
401 | mem_device->handle = device->handle; | 401 | mem_device->device = device; |
402 | sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); | 402 | sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); |
403 | sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); | 403 | sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); |
404 | acpi_driver_data(device) = mem_device; | 404 | acpi_driver_data(device) = mem_device; |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 7d92f73b265f..2b8aab560b58 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -108,7 +108,7 @@ struct acpi_battery_trips { | |||
108 | }; | 108 | }; |
109 | 109 | ||
110 | struct acpi_battery { | 110 | struct acpi_battery { |
111 | acpi_handle handle; | 111 | struct acpi_device * device; |
112 | struct acpi_battery_flags flags; | 112 | struct acpi_battery_flags flags; |
113 | struct acpi_battery_trips trips; | 113 | struct acpi_battery_trips trips; |
114 | unsigned long alarm; | 114 | unsigned long alarm; |
@@ -138,7 +138,7 @@ acpi_battery_get_info(struct acpi_battery *battery, | |||
138 | 138 | ||
139 | /* Evalute _BIF */ | 139 | /* Evalute _BIF */ |
140 | 140 | ||
141 | status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer); | 141 | status = acpi_evaluate_object(battery->device->handle, "_BIF", NULL, &buffer); |
142 | if (ACPI_FAILURE(status)) { | 142 | if (ACPI_FAILURE(status)) { |
143 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); | 143 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); |
144 | return -ENODEV; | 144 | return -ENODEV; |
@@ -198,7 +198,7 @@ acpi_battery_get_status(struct acpi_battery *battery, | |||
198 | 198 | ||
199 | /* Evalute _BST */ | 199 | /* Evalute _BST */ |
200 | 200 | ||
201 | status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer); | 201 | status = acpi_evaluate_object(battery->device->handle, "_BST", NULL, &buffer); |
202 | if (ACPI_FAILURE(status)) { | 202 | if (ACPI_FAILURE(status)) { |
203 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); | 203 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); |
204 | return -ENODEV; | 204 | return -ENODEV; |
@@ -255,7 +255,7 @@ acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm) | |||
255 | 255 | ||
256 | arg0.integer.value = alarm; | 256 | arg0.integer.value = alarm; |
257 | 257 | ||
258 | status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL); | 258 | status = acpi_evaluate_object(battery->device->handle, "_BTP", &arg_list, NULL); |
259 | if (ACPI_FAILURE(status)) | 259 | if (ACPI_FAILURE(status)) |
260 | return -ENODEV; | 260 | return -ENODEV; |
261 | 261 | ||
@@ -278,9 +278,7 @@ static int acpi_battery_check(struct acpi_battery *battery) | |||
278 | if (!battery) | 278 | if (!battery) |
279 | return -EINVAL; | 279 | return -EINVAL; |
280 | 280 | ||
281 | result = acpi_bus_get_device(battery->handle, &device); | 281 | device = battery->device; |
282 | if (result) | ||
283 | return result; | ||
284 | 282 | ||
285 | result = acpi_bus_get_status(device); | 283 | result = acpi_bus_get_status(device); |
286 | if (result) | 284 | if (result) |
@@ -305,7 +303,7 @@ static int acpi_battery_check(struct acpi_battery *battery) | |||
305 | 303 | ||
306 | /* See if alarms are supported, and if so, set default */ | 304 | /* See if alarms are supported, and if so, set default */ |
307 | 305 | ||
308 | status = acpi_get_handle(battery->handle, "_BTP", &handle); | 306 | status = acpi_get_handle(battery->device->handle, "_BTP", &handle); |
309 | if (ACPI_SUCCESS(status)) { | 307 | if (ACPI_SUCCESS(status)) { |
310 | battery->flags.alarm = 1; | 308 | battery->flags.alarm = 1; |
311 | acpi_battery_set_alarm(battery, battery->trips.warning); | 309 | acpi_battery_set_alarm(battery, battery->trips.warning); |
@@ -662,8 +660,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) | |||
662 | if (!battery) | 660 | if (!battery) |
663 | return; | 661 | return; |
664 | 662 | ||
665 | if (acpi_bus_get_device(handle, &device)) | 663 | device = battery->device; |
666 | return; | ||
667 | 664 | ||
668 | switch (event) { | 665 | switch (event) { |
669 | case ACPI_BATTERY_NOTIFY_STATUS: | 666 | case ACPI_BATTERY_NOTIFY_STATUS: |
@@ -695,7 +692,7 @@ static int acpi_battery_add(struct acpi_device *device) | |||
695 | return -ENOMEM; | 692 | return -ENOMEM; |
696 | memset(battery, 0, sizeof(struct acpi_battery)); | 693 | memset(battery, 0, sizeof(struct acpi_battery)); |
697 | 694 | ||
698 | battery->handle = device->handle; | 695 | battery->device = device; |
699 | strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); | 696 | strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); |
700 | strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); | 697 | strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); |
701 | acpi_driver_data(device) = battery; | 698 | acpi_driver_data(device) = battery; |
@@ -708,7 +705,7 @@ static int acpi_battery_add(struct acpi_device *device) | |||
708 | if (result) | 705 | if (result) |
709 | goto end; | 706 | goto end; |
710 | 707 | ||
711 | status = acpi_install_notify_handler(battery->handle, | 708 | status = acpi_install_notify_handler(device->handle, |
712 | ACPI_DEVICE_NOTIFY, | 709 | ACPI_DEVICE_NOTIFY, |
713 | acpi_battery_notify, battery); | 710 | acpi_battery_notify, battery); |
714 | if (ACPI_FAILURE(status)) { | 711 | if (ACPI_FAILURE(status)) { |
@@ -740,7 +737,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type) | |||
740 | 737 | ||
741 | battery = (struct acpi_battery *)acpi_driver_data(device); | 738 | battery = (struct acpi_battery *)acpi_driver_data(device); |
742 | 739 | ||
743 | status = acpi_remove_notify_handler(battery->handle, | 740 | status = acpi_remove_notify_handler(device->handle, |
744 | ACPI_DEVICE_NOTIFY, | 741 | ACPI_DEVICE_NOTIFY, |
745 | acpi_battery_notify); | 742 | acpi_battery_notify); |
746 | 743 | ||
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 02594639c4d9..fd1ba05eab68 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -82,7 +82,6 @@ static struct acpi_driver acpi_button_driver = { | |||
82 | }; | 82 | }; |
83 | 83 | ||
84 | struct acpi_button { | 84 | struct acpi_button { |
85 | acpi_handle handle; | ||
86 | struct acpi_device *device; /* Fixed button kludge */ | 85 | struct acpi_device *device; /* Fixed button kludge */ |
87 | u8 type; | 86 | u8 type; |
88 | unsigned long pushed; | 87 | unsigned long pushed; |
@@ -137,7 +136,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) | |||
137 | if (!button || !button->device) | 136 | if (!button || !button->device) |
138 | return 0; | 137 | return 0; |
139 | 138 | ||
140 | status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state); | 139 | status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state); |
141 | if (ACPI_FAILURE(status)) { | 140 | if (ACPI_FAILURE(status)) { |
142 | seq_printf(seq, "state: unsupported\n"); | 141 | seq_printf(seq, "state: unsupported\n"); |
143 | } else { | 142 | } else { |
@@ -282,7 +281,7 @@ static acpi_status acpi_button_notify_fixed(void *data) | |||
282 | if (!button) | 281 | if (!button) |
283 | return AE_BAD_PARAMETER; | 282 | return AE_BAD_PARAMETER; |
284 | 283 | ||
285 | acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); | 284 | acpi_button_notify(button->device->handle, ACPI_BUTTON_NOTIFY_STATUS, button); |
286 | 285 | ||
287 | return AE_OK; | 286 | return AE_OK; |
288 | } | 287 | } |
@@ -303,7 +302,6 @@ static int acpi_button_add(struct acpi_device *device) | |||
303 | memset(button, 0, sizeof(struct acpi_button)); | 302 | memset(button, 0, sizeof(struct acpi_button)); |
304 | 303 | ||
305 | button->device = device; | 304 | button->device = device; |
306 | button->handle = device->handle; | ||
307 | acpi_driver_data(device) = button; | 305 | acpi_driver_data(device) = button; |
308 | 306 | ||
309 | /* | 307 | /* |
@@ -362,7 +360,7 @@ static int acpi_button_add(struct acpi_device *device) | |||
362 | button); | 360 | button); |
363 | break; | 361 | break; |
364 | default: | 362 | default: |
365 | status = acpi_install_notify_handler(button->handle, | 363 | status = acpi_install_notify_handler(device->handle, |
366 | ACPI_DEVICE_NOTIFY, | 364 | ACPI_DEVICE_NOTIFY, |
367 | acpi_button_notify, | 365 | acpi_button_notify, |
368 | button); | 366 | button); |
@@ -420,7 +418,7 @@ static int acpi_button_remove(struct acpi_device *device, int type) | |||
420 | acpi_button_notify_fixed); | 418 | acpi_button_notify_fixed); |
421 | break; | 419 | break; |
422 | default: | 420 | default: |
423 | status = acpi_remove_notify_handler(button->handle, | 421 | status = acpi_remove_notify_handler(device->handle, |
424 | ACPI_DEVICE_NOTIFY, | 422 | ACPI_DEVICE_NOTIFY, |
425 | acpi_button_notify); | 423 | acpi_button_notify); |
426 | break; | 424 | break; |
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 38acc69b21bc..daed2460924d 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -64,7 +64,7 @@ static struct acpi_driver acpi_fan_driver = { | |||
64 | }; | 64 | }; |
65 | 65 | ||
66 | struct acpi_fan { | 66 | struct acpi_fan { |
67 | acpi_handle handle; | 67 | struct acpi_device * device; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | /* -------------------------------------------------------------------------- | 70 | /* -------------------------------------------------------------------------- |
@@ -80,7 +80,7 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset) | |||
80 | 80 | ||
81 | 81 | ||
82 | if (fan) { | 82 | if (fan) { |
83 | if (acpi_bus_get_power(fan->handle, &state)) | 83 | if (acpi_bus_get_power(fan->device->handle, &state)) |
84 | seq_printf(seq, "status: ERROR\n"); | 84 | seq_printf(seq, "status: ERROR\n"); |
85 | else | 85 | else |
86 | seq_printf(seq, "status: %s\n", | 86 | seq_printf(seq, "status: %s\n", |
@@ -112,7 +112,7 @@ acpi_fan_write_state(struct file *file, const char __user * buffer, | |||
112 | 112 | ||
113 | state_string[count] = '\0'; | 113 | state_string[count] = '\0'; |
114 | 114 | ||
115 | result = acpi_bus_set_power(fan->handle, | 115 | result = acpi_bus_set_power(fan->device->handle, |
116 | simple_strtoul(state_string, NULL, 0)); | 116 | simple_strtoul(state_string, NULL, 0)); |
117 | if (result) | 117 | if (result) |
118 | return result; | 118 | return result; |
@@ -191,12 +191,12 @@ static int acpi_fan_add(struct acpi_device *device) | |||
191 | return -ENOMEM; | 191 | return -ENOMEM; |
192 | memset(fan, 0, sizeof(struct acpi_fan)); | 192 | memset(fan, 0, sizeof(struct acpi_fan)); |
193 | 193 | ||
194 | fan->handle = device->handle; | 194 | fan->device = device; |
195 | strcpy(acpi_device_name(device), "Fan"); | 195 | strcpy(acpi_device_name(device), "Fan"); |
196 | strcpy(acpi_device_class(device), ACPI_FAN_CLASS); | 196 | strcpy(acpi_device_class(device), ACPI_FAN_CLASS); |
197 | acpi_driver_data(device) = fan; | 197 | acpi_driver_data(device) = fan; |
198 | 198 | ||
199 | result = acpi_bus_get_power(fan->handle, &state); | 199 | result = acpi_bus_get_power(device->handle, &state); |
200 | if (result) { | 200 | if (result) { |
201 | printk(KERN_ERR PREFIX "Reading power state\n"); | 201 | printk(KERN_ERR PREFIX "Reading power state\n"); |
202 | goto end; | 202 | goto end; |
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 1badce27a83f..8197c0e40769 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
@@ -83,7 +83,6 @@ struct acpi_pci_link_irq { | |||
83 | struct acpi_pci_link { | 83 | struct acpi_pci_link { |
84 | struct list_head node; | 84 | struct list_head node; |
85 | struct acpi_device *device; | 85 | struct acpi_device *device; |
86 | acpi_handle handle; | ||
87 | struct acpi_pci_link_irq irq; | 86 | struct acpi_pci_link_irq irq; |
88 | int refcnt; | 87 | int refcnt; |
89 | }; | 88 | }; |
@@ -175,7 +174,7 @@ static int acpi_pci_link_get_possible(struct acpi_pci_link *link) | |||
175 | if (!link) | 174 | if (!link) |
176 | return -EINVAL; | 175 | return -EINVAL; |
177 | 176 | ||
178 | status = acpi_walk_resources(link->handle, METHOD_NAME__PRS, | 177 | status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS, |
179 | acpi_pci_link_check_possible, link); | 178 | acpi_pci_link_check_possible, link); |
180 | if (ACPI_FAILURE(status)) { | 179 | if (ACPI_FAILURE(status)) { |
181 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS")); | 180 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS")); |
@@ -249,8 +248,7 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) | |||
249 | acpi_status status = AE_OK; | 248 | acpi_status status = AE_OK; |
250 | int irq = 0; | 249 | int irq = 0; |
251 | 250 | ||
252 | 251 | if (!link) | |
253 | if (!link || !link->handle) | ||
254 | return -EINVAL; | 252 | return -EINVAL; |
255 | 253 | ||
256 | link->irq.active = 0; | 254 | link->irq.active = 0; |
@@ -274,7 +272,7 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) | |||
274 | * Query and parse _CRS to get the current IRQ assignment. | 272 | * Query and parse _CRS to get the current IRQ assignment. |
275 | */ | 273 | */ |
276 | 274 | ||
277 | status = acpi_walk_resources(link->handle, METHOD_NAME__CRS, | 275 | status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, |
278 | acpi_pci_link_check_current, &irq); | 276 | acpi_pci_link_check_current, &irq); |
279 | if (ACPI_FAILURE(status)) { | 277 | if (ACPI_FAILURE(status)) { |
280 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS")); | 278 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS")); |
@@ -360,7 +358,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) | |||
360 | resource->end.type = ACPI_RESOURCE_TYPE_END_TAG; | 358 | resource->end.type = ACPI_RESOURCE_TYPE_END_TAG; |
361 | 359 | ||
362 | /* Attempt to set the resource */ | 360 | /* Attempt to set the resource */ |
363 | status = acpi_set_current_resources(link->handle, &buffer); | 361 | status = acpi_set_current_resources(link->device->handle, &buffer); |
364 | 362 | ||
365 | /* check for total failure */ | 363 | /* check for total failure */ |
366 | if (ACPI_FAILURE(status)) { | 364 | if (ACPI_FAILURE(status)) { |
@@ -699,7 +697,7 @@ int acpi_pci_link_free_irq(acpi_handle handle) | |||
699 | acpi_device_bid(link->device))); | 697 | acpi_device_bid(link->device))); |
700 | 698 | ||
701 | if (link->refcnt == 0) { | 699 | if (link->refcnt == 0) { |
702 | acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); | 700 | acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL); |
703 | } | 701 | } |
704 | mutex_unlock(&acpi_link_lock); | 702 | mutex_unlock(&acpi_link_lock); |
705 | return (link->irq.active); | 703 | return (link->irq.active); |
@@ -726,7 +724,6 @@ static int acpi_pci_link_add(struct acpi_device *device) | |||
726 | memset(link, 0, sizeof(struct acpi_pci_link)); | 724 | memset(link, 0, sizeof(struct acpi_pci_link)); |
727 | 725 | ||
728 | link->device = device; | 726 | link->device = device; |
729 | link->handle = device->handle; | ||
730 | strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); | 727 | strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); |
731 | strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); | 728 | strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); |
732 | acpi_driver_data(device) = link; | 729 | acpi_driver_data(device) = link; |
@@ -765,7 +762,7 @@ static int acpi_pci_link_add(struct acpi_device *device) | |||
765 | 762 | ||
766 | end: | 763 | end: |
767 | /* disable all links -- to be activated on use */ | 764 | /* disable all links -- to be activated on use */ |
768 | acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); | 765 | acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL); |
769 | mutex_unlock(&acpi_link_lock); | 766 | mutex_unlock(&acpi_link_lock); |
770 | 767 | ||
771 | if (result) | 768 | if (result) |
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 8f10442119f0..0984a1ee24ed 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -58,7 +58,7 @@ static struct acpi_driver acpi_pci_root_driver = { | |||
58 | 58 | ||
59 | struct acpi_pci_root { | 59 | struct acpi_pci_root { |
60 | struct list_head node; | 60 | struct list_head node; |
61 | acpi_handle handle; | 61 | struct acpi_device * device; |
62 | struct acpi_pci_id id; | 62 | struct acpi_pci_id id; |
63 | struct pci_bus *bus; | 63 | struct pci_bus *bus; |
64 | }; | 64 | }; |
@@ -83,7 +83,7 @@ int acpi_pci_register_driver(struct acpi_pci_driver *driver) | |||
83 | list_for_each(entry, &acpi_pci_roots) { | 83 | list_for_each(entry, &acpi_pci_roots) { |
84 | struct acpi_pci_root *root; | 84 | struct acpi_pci_root *root; |
85 | root = list_entry(entry, struct acpi_pci_root, node); | 85 | root = list_entry(entry, struct acpi_pci_root, node); |
86 | driver->add(root->handle); | 86 | driver->add(root->device->handle); |
87 | n++; | 87 | n++; |
88 | } | 88 | } |
89 | 89 | ||
@@ -110,7 +110,7 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) | |||
110 | list_for_each(entry, &acpi_pci_roots) { | 110 | list_for_each(entry, &acpi_pci_roots) { |
111 | struct acpi_pci_root *root; | 111 | struct acpi_pci_root *root; |
112 | root = list_entry(entry, struct acpi_pci_root, node); | 112 | root = list_entry(entry, struct acpi_pci_root, node); |
113 | driver->remove(root->handle); | 113 | driver->remove(root->device->handle); |
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
@@ -170,7 +170,7 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
170 | memset(root, 0, sizeof(struct acpi_pci_root)); | 170 | memset(root, 0, sizeof(struct acpi_pci_root)); |
171 | INIT_LIST_HEAD(&root->node); | 171 | INIT_LIST_HEAD(&root->node); |
172 | 172 | ||
173 | root->handle = device->handle; | 173 | root->device = device; |
174 | strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); | 174 | strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); |
175 | strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); | 175 | strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); |
176 | acpi_driver_data(device) = root; | 176 | acpi_driver_data(device) = root; |
@@ -185,7 +185,7 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
185 | * ------- | 185 | * ------- |
186 | * Obtained via _SEG, if exists, otherwise assumed to be zero (0). | 186 | * Obtained via _SEG, if exists, otherwise assumed to be zero (0). |
187 | */ | 187 | */ |
188 | status = acpi_evaluate_integer(root->handle, METHOD_NAME__SEG, NULL, | 188 | status = acpi_evaluate_integer(device->handle, METHOD_NAME__SEG, NULL, |
189 | &value); | 189 | &value); |
190 | switch (status) { | 190 | switch (status) { |
191 | case AE_OK: | 191 | case AE_OK: |
@@ -207,7 +207,7 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
207 | * --- | 207 | * --- |
208 | * Obtained via _BBN, if exists, otherwise assumed to be zero (0). | 208 | * Obtained via _BBN, if exists, otherwise assumed to be zero (0). |
209 | */ | 209 | */ |
210 | status = acpi_evaluate_integer(root->handle, METHOD_NAME__BBN, NULL, | 210 | status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL, |
211 | &value); | 211 | &value); |
212 | switch (status) { | 212 | switch (status) { |
213 | case AE_OK: | 213 | case AE_OK: |
@@ -234,7 +234,7 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
234 | "Wrong _BBN value, reboot" | 234 | "Wrong _BBN value, reboot" |
235 | " and use option 'pci=noacpi'\n"); | 235 | " and use option 'pci=noacpi'\n"); |
236 | 236 | ||
237 | status = try_get_root_bridge_busnr(root->handle, &bus); | 237 | status = try_get_root_bridge_busnr(device->handle, &bus); |
238 | if (ACPI_FAILURE(status)) | 238 | if (ACPI_FAILURE(status)) |
239 | break; | 239 | break; |
240 | if (bus != root->id.bus) { | 240 | if (bus != root->id.bus) { |
@@ -294,9 +294,9 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
294 | * ----------------- | 294 | * ----------------- |
295 | * Evaluate and parse _PRT, if exists. | 295 | * Evaluate and parse _PRT, if exists. |
296 | */ | 296 | */ |
297 | status = acpi_get_handle(root->handle, METHOD_NAME__PRT, &handle); | 297 | status = acpi_get_handle(device->handle, METHOD_NAME__PRT, &handle); |
298 | if (ACPI_SUCCESS(status)) | 298 | if (ACPI_SUCCESS(status)) |
299 | result = acpi_pci_irq_add_prt(root->handle, root->id.segment, | 299 | result = acpi_pci_irq_add_prt(device->handle, root->id.segment, |
300 | root->id.bus); | 300 | root->id.bus); |
301 | 301 | ||
302 | end: | 302 | end: |
@@ -315,7 +315,7 @@ static int acpi_pci_root_start(struct acpi_device *device) | |||
315 | 315 | ||
316 | 316 | ||
317 | list_for_each_entry(root, &acpi_pci_roots, node) { | 317 | list_for_each_entry(root, &acpi_pci_roots, node) { |
318 | if (root->handle == device->handle) { | 318 | if (root->device == device) { |
319 | pci_bus_add_devices(root->bus); | 319 | pci_bus_add_devices(root->bus); |
320 | return 0; | 320 | return 0; |
321 | } | 321 | } |
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 224f729f700e..5d3447f4582c 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
@@ -70,7 +70,7 @@ static struct acpi_driver acpi_power_driver = { | |||
70 | }; | 70 | }; |
71 | 71 | ||
72 | struct acpi_power_resource { | 72 | struct acpi_power_resource { |
73 | acpi_handle handle; | 73 | struct acpi_device * device; |
74 | acpi_bus_id name; | 74 | acpi_bus_id name; |
75 | u32 system_level; | 75 | u32 system_level; |
76 | u32 order; | 76 | u32 order; |
@@ -124,7 +124,7 @@ static int acpi_power_get_state(struct acpi_power_resource *resource) | |||
124 | if (!resource) | 124 | if (!resource) |
125 | return -EINVAL; | 125 | return -EINVAL; |
126 | 126 | ||
127 | status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta); | 127 | status = acpi_evaluate_integer(resource->device->handle, "_STA", NULL, &sta); |
128 | if (ACPI_FAILURE(status)) | 128 | if (ACPI_FAILURE(status)) |
129 | return -ENODEV; | 129 | return -ENODEV; |
130 | 130 | ||
@@ -192,7 +192,7 @@ static int acpi_power_on(acpi_handle handle) | |||
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |
194 | 194 | ||
195 | status = acpi_evaluate_object(resource->handle, "_ON", NULL, NULL); | 195 | status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL); |
196 | if (ACPI_FAILURE(status)) | 196 | if (ACPI_FAILURE(status)) |
197 | return -ENODEV; | 197 | return -ENODEV; |
198 | 198 | ||
@@ -203,10 +203,8 @@ static int acpi_power_on(acpi_handle handle) | |||
203 | return -ENOEXEC; | 203 | return -ENOEXEC; |
204 | 204 | ||
205 | /* Update the power resource's _device_ power state */ | 205 | /* Update the power resource's _device_ power state */ |
206 | result = acpi_bus_get_device(resource->handle, &device); | 206 | device = resource->device; |
207 | if (result) | 207 | resource->device->power.state = ACPI_STATE_D0; |
208 | return result; | ||
209 | device->power.state = ACPI_STATE_D0; | ||
210 | 208 | ||
211 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n", | 209 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n", |
212 | resource->name)); | 210 | resource->name)); |
@@ -242,7 +240,7 @@ static int acpi_power_off_device(acpi_handle handle) | |||
242 | return 0; | 240 | return 0; |
243 | } | 241 | } |
244 | 242 | ||
245 | status = acpi_evaluate_object(resource->handle, "_OFF", NULL, NULL); | 243 | status = acpi_evaluate_object(resource->device->handle, "_OFF", NULL, NULL); |
246 | if (ACPI_FAILURE(status)) | 244 | if (ACPI_FAILURE(status)) |
247 | return -ENODEV; | 245 | return -ENODEV; |
248 | 246 | ||
@@ -253,9 +251,7 @@ static int acpi_power_off_device(acpi_handle handle) | |||
253 | return -ENOEXEC; | 251 | return -ENOEXEC; |
254 | 252 | ||
255 | /* Update the power resource's _device_ power state */ | 253 | /* Update the power resource's _device_ power state */ |
256 | result = acpi_bus_get_device(resource->handle, &device); | 254 | device = resource->device; |
257 | if (result) | ||
258 | return result; | ||
259 | device->power.state = ACPI_STATE_D3; | 255 | device->power.state = ACPI_STATE_D3; |
260 | 256 | ||
261 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n", | 257 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n", |
@@ -544,14 +540,14 @@ static int acpi_power_add(struct acpi_device *device) | |||
544 | return -ENOMEM; | 540 | return -ENOMEM; |
545 | memset(resource, 0, sizeof(struct acpi_power_resource)); | 541 | memset(resource, 0, sizeof(struct acpi_power_resource)); |
546 | 542 | ||
547 | resource->handle = device->handle; | 543 | resource->device = device; |
548 | strcpy(resource->name, device->pnp.bus_id); | 544 | strcpy(resource->name, device->pnp.bus_id); |
549 | strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); | 545 | strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); |
550 | strcpy(acpi_device_class(device), ACPI_POWER_CLASS); | 546 | strcpy(acpi_device_class(device), ACPI_POWER_CLASS); |
551 | acpi_driver_data(device) = resource; | 547 | acpi_driver_data(device) = resource; |
552 | 548 | ||
553 | /* Evalute the object to get the system level and resource order. */ | 549 | /* Evalute the object to get the system level and resource order. */ |
554 | status = acpi_evaluate_object(resource->handle, NULL, NULL, &buffer); | 550 | status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer); |
555 | if (ACPI_FAILURE(status)) { | 551 | if (ACPI_FAILURE(status)) { |
556 | result = -ENODEV; | 552 | result = -ENODEV; |
557 | goto end; | 553 | goto end; |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index c855f4446b5f..503c0b99db12 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -162,7 +162,7 @@ struct acpi_thermal_flags { | |||
162 | }; | 162 | }; |
163 | 163 | ||
164 | struct acpi_thermal { | 164 | struct acpi_thermal { |
165 | acpi_handle handle; | 165 | struct acpi_device * device; |
166 | acpi_bus_id name; | 166 | acpi_bus_id name; |
167 | unsigned long temperature; | 167 | unsigned long temperature; |
168 | unsigned long last_temperature; | 168 | unsigned long last_temperature; |
@@ -229,7 +229,7 @@ static int acpi_thermal_get_temperature(struct acpi_thermal *tz) | |||
229 | tz->last_temperature = tz->temperature; | 229 | tz->last_temperature = tz->temperature; |
230 | 230 | ||
231 | status = | 231 | status = |
232 | acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature); | 232 | acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tz->temperature); |
233 | if (ACPI_FAILURE(status)) | 233 | if (ACPI_FAILURE(status)) |
234 | return -ENODEV; | 234 | return -ENODEV; |
235 | 235 | ||
@@ -248,7 +248,7 @@ static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) | |||
248 | return -EINVAL; | 248 | return -EINVAL; |
249 | 249 | ||
250 | status = | 250 | status = |
251 | acpi_evaluate_integer(tz->handle, "_TZP", NULL, | 251 | acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, |
252 | &tz->polling_frequency); | 252 | &tz->polling_frequency); |
253 | if (ACPI_FAILURE(status)) | 253 | if (ACPI_FAILURE(status)) |
254 | return -ENODEV; | 254 | return -ENODEV; |
@@ -285,7 +285,7 @@ static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode) | |||
285 | if (!tz) | 285 | if (!tz) |
286 | return -EINVAL; | 286 | return -EINVAL; |
287 | 287 | ||
288 | status = acpi_get_handle(tz->handle, "_SCP", &handle); | 288 | status = acpi_get_handle(tz->device->handle, "_SCP", &handle); |
289 | if (ACPI_FAILURE(status)) { | 289 | if (ACPI_FAILURE(status)) { |
290 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n")); | 290 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n")); |
291 | return -ENODEV; | 291 | return -ENODEV; |
@@ -316,7 +316,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) | |||
316 | 316 | ||
317 | /* Critical Shutdown (required) */ | 317 | /* Critical Shutdown (required) */ |
318 | 318 | ||
319 | status = acpi_evaluate_integer(tz->handle, "_CRT", NULL, | 319 | status = acpi_evaluate_integer(tz->device->handle, "_CRT", NULL, |
320 | &tz->trips.critical.temperature); | 320 | &tz->trips.critical.temperature); |
321 | if (ACPI_FAILURE(status)) { | 321 | if (ACPI_FAILURE(status)) { |
322 | tz->trips.critical.flags.valid = 0; | 322 | tz->trips.critical.flags.valid = 0; |
@@ -332,7 +332,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) | |||
332 | /* Critical Sleep (optional) */ | 332 | /* Critical Sleep (optional) */ |
333 | 333 | ||
334 | status = | 334 | status = |
335 | acpi_evaluate_integer(tz->handle, "_HOT", NULL, | 335 | acpi_evaluate_integer(tz->device->handle, "_HOT", NULL, |
336 | &tz->trips.hot.temperature); | 336 | &tz->trips.hot.temperature); |
337 | if (ACPI_FAILURE(status)) { | 337 | if (ACPI_FAILURE(status)) { |
338 | tz->trips.hot.flags.valid = 0; | 338 | tz->trips.hot.flags.valid = 0; |
@@ -346,7 +346,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) | |||
346 | /* Passive: Processors (optional) */ | 346 | /* Passive: Processors (optional) */ |
347 | 347 | ||
348 | status = | 348 | status = |
349 | acpi_evaluate_integer(tz->handle, "_PSV", NULL, | 349 | acpi_evaluate_integer(tz->device->handle, "_PSV", NULL, |
350 | &tz->trips.passive.temperature); | 350 | &tz->trips.passive.temperature); |
351 | if (ACPI_FAILURE(status)) { | 351 | if (ACPI_FAILURE(status)) { |
352 | tz->trips.passive.flags.valid = 0; | 352 | tz->trips.passive.flags.valid = 0; |
@@ -355,25 +355,25 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) | |||
355 | tz->trips.passive.flags.valid = 1; | 355 | tz->trips.passive.flags.valid = 1; |
356 | 356 | ||
357 | status = | 357 | status = |
358 | acpi_evaluate_integer(tz->handle, "_TC1", NULL, | 358 | acpi_evaluate_integer(tz->device->handle, "_TC1", NULL, |
359 | &tz->trips.passive.tc1); | 359 | &tz->trips.passive.tc1); |
360 | if (ACPI_FAILURE(status)) | 360 | if (ACPI_FAILURE(status)) |
361 | tz->trips.passive.flags.valid = 0; | 361 | tz->trips.passive.flags.valid = 0; |
362 | 362 | ||
363 | status = | 363 | status = |
364 | acpi_evaluate_integer(tz->handle, "_TC2", NULL, | 364 | acpi_evaluate_integer(tz->device->handle, "_TC2", NULL, |
365 | &tz->trips.passive.tc2); | 365 | &tz->trips.passive.tc2); |
366 | if (ACPI_FAILURE(status)) | 366 | if (ACPI_FAILURE(status)) |
367 | tz->trips.passive.flags.valid = 0; | 367 | tz->trips.passive.flags.valid = 0; |
368 | 368 | ||
369 | status = | 369 | status = |
370 | acpi_evaluate_integer(tz->handle, "_TSP", NULL, | 370 | acpi_evaluate_integer(tz->device->handle, "_TSP", NULL, |
371 | &tz->trips.passive.tsp); | 371 | &tz->trips.passive.tsp); |
372 | if (ACPI_FAILURE(status)) | 372 | if (ACPI_FAILURE(status)) |
373 | tz->trips.passive.flags.valid = 0; | 373 | tz->trips.passive.flags.valid = 0; |
374 | 374 | ||
375 | status = | 375 | status = |
376 | acpi_evaluate_reference(tz->handle, "_PSL", NULL, | 376 | acpi_evaluate_reference(tz->device->handle, "_PSL", NULL, |
377 | &tz->trips.passive.devices); | 377 | &tz->trips.passive.devices); |
378 | if (ACPI_FAILURE(status)) | 378 | if (ACPI_FAILURE(status)) |
379 | tz->trips.passive.flags.valid = 0; | 379 | tz->trips.passive.flags.valid = 0; |
@@ -393,14 +393,14 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) | |||
393 | char name[5] = { '_', 'A', 'C', ('0' + i), '\0' }; | 393 | char name[5] = { '_', 'A', 'C', ('0' + i), '\0' }; |
394 | 394 | ||
395 | status = | 395 | status = |
396 | acpi_evaluate_integer(tz->handle, name, NULL, | 396 | acpi_evaluate_integer(tz->device->handle, name, NULL, |
397 | &tz->trips.active[i].temperature); | 397 | &tz->trips.active[i].temperature); |
398 | if (ACPI_FAILURE(status)) | 398 | if (ACPI_FAILURE(status)) |
399 | break; | 399 | break; |
400 | 400 | ||
401 | name[2] = 'L'; | 401 | name[2] = 'L'; |
402 | status = | 402 | status = |
403 | acpi_evaluate_reference(tz->handle, name, NULL, | 403 | acpi_evaluate_reference(tz->device->handle, name, NULL, |
404 | &tz->trips.active[i].devices); | 404 | &tz->trips.active[i].devices); |
405 | if (ACPI_SUCCESS(status)) { | 405 | if (ACPI_SUCCESS(status)) { |
406 | tz->trips.active[i].flags.valid = 1; | 406 | tz->trips.active[i].flags.valid = 1; |
@@ -424,7 +424,7 @@ static int acpi_thermal_get_devices(struct acpi_thermal *tz) | |||
424 | return -EINVAL; | 424 | return -EINVAL; |
425 | 425 | ||
426 | status = | 426 | status = |
427 | acpi_evaluate_reference(tz->handle, "_TZD", NULL, &tz->devices); | 427 | acpi_evaluate_reference(tz->device->handle, "_TZD", NULL, &tz->devices); |
428 | if (ACPI_FAILURE(status)) | 428 | if (ACPI_FAILURE(status)) |
429 | return -ENODEV; | 429 | return -ENODEV; |
430 | 430 | ||
@@ -453,10 +453,6 @@ static int acpi_thermal_call_usermode(char *path) | |||
453 | 453 | ||
454 | static int acpi_thermal_critical(struct acpi_thermal *tz) | 454 | static int acpi_thermal_critical(struct acpi_thermal *tz) |
455 | { | 455 | { |
456 | int result = 0; | ||
457 | struct acpi_device *device = NULL; | ||
458 | |||
459 | |||
460 | if (!tz || !tz->trips.critical.flags.valid) | 456 | if (!tz || !tz->trips.critical.flags.valid) |
461 | return -EINVAL; | 457 | return -EINVAL; |
462 | 458 | ||
@@ -466,14 +462,10 @@ static int acpi_thermal_critical(struct acpi_thermal *tz) | |||
466 | } else if (tz->trips.critical.flags.enabled) | 462 | } else if (tz->trips.critical.flags.enabled) |
467 | tz->trips.critical.flags.enabled = 0; | 463 | tz->trips.critical.flags.enabled = 0; |
468 | 464 | ||
469 | result = acpi_bus_get_device(tz->handle, &device); | ||
470 | if (result) | ||
471 | return result; | ||
472 | |||
473 | printk(KERN_EMERG | 465 | printk(KERN_EMERG |
474 | "Critical temperature reached (%ld C), shutting down.\n", | 466 | "Critical temperature reached (%ld C), shutting down.\n", |
475 | KELVIN_TO_CELSIUS(tz->temperature)); | 467 | KELVIN_TO_CELSIUS(tz->temperature)); |
476 | acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL, | 468 | acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, |
477 | tz->trips.critical.flags.enabled); | 469 | tz->trips.critical.flags.enabled); |
478 | 470 | ||
479 | acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF); | 471 | acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF); |
@@ -483,10 +475,6 @@ static int acpi_thermal_critical(struct acpi_thermal *tz) | |||
483 | 475 | ||
484 | static int acpi_thermal_hot(struct acpi_thermal *tz) | 476 | static int acpi_thermal_hot(struct acpi_thermal *tz) |
485 | { | 477 | { |
486 | int result = 0; | ||
487 | struct acpi_device *device = NULL; | ||
488 | |||
489 | |||
490 | if (!tz || !tz->trips.hot.flags.valid) | 478 | if (!tz || !tz->trips.hot.flags.valid) |
491 | return -EINVAL; | 479 | return -EINVAL; |
492 | 480 | ||
@@ -496,11 +484,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz) | |||
496 | } else if (tz->trips.hot.flags.enabled) | 484 | } else if (tz->trips.hot.flags.enabled) |
497 | tz->trips.hot.flags.enabled = 0; | 485 | tz->trips.hot.flags.enabled = 0; |
498 | 486 | ||
499 | result = acpi_bus_get_device(tz->handle, &device); | 487 | acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, |
500 | if (result) | ||
501 | return result; | ||
502 | |||
503 | acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_HOT, | ||
504 | tz->trips.hot.flags.enabled); | 488 | tz->trips.hot.flags.enabled); |
505 | 489 | ||
506 | /* TBD: Call user-mode "sleep(S4)" function */ | 490 | /* TBD: Call user-mode "sleep(S4)" function */ |
@@ -1193,8 +1177,7 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data) | |||
1193 | if (!tz) | 1177 | if (!tz) |
1194 | return; | 1178 | return; |
1195 | 1179 | ||
1196 | if (acpi_bus_get_device(tz->handle, &device)) | 1180 | device = tz->device; |
1197 | return; | ||
1198 | 1181 | ||
1199 | switch (event) { | 1182 | switch (event) { |
1200 | case ACPI_THERMAL_NOTIFY_TEMPERATURE: | 1183 | case ACPI_THERMAL_NOTIFY_TEMPERATURE: |
@@ -1293,7 +1276,7 @@ static int acpi_thermal_add(struct acpi_device *device) | |||
1293 | return -ENOMEM; | 1276 | return -ENOMEM; |
1294 | memset(tz, 0, sizeof(struct acpi_thermal)); | 1277 | memset(tz, 0, sizeof(struct acpi_thermal)); |
1295 | 1278 | ||
1296 | tz->handle = device->handle; | 1279 | tz->device = device; |
1297 | strcpy(tz->name, device->pnp.bus_id); | 1280 | strcpy(tz->name, device->pnp.bus_id); |
1298 | strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); | 1281 | strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); |
1299 | strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); | 1282 | strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); |
@@ -1311,7 +1294,7 @@ static int acpi_thermal_add(struct acpi_device *device) | |||
1311 | 1294 | ||
1312 | acpi_thermal_check(tz); | 1295 | acpi_thermal_check(tz); |
1313 | 1296 | ||
1314 | status = acpi_install_notify_handler(tz->handle, | 1297 | status = acpi_install_notify_handler(device->handle, |
1315 | ACPI_DEVICE_NOTIFY, | 1298 | ACPI_DEVICE_NOTIFY, |
1316 | acpi_thermal_notify, tz); | 1299 | acpi_thermal_notify, tz); |
1317 | if (ACPI_FAILURE(status)) { | 1300 | if (ACPI_FAILURE(status)) { |
@@ -1352,7 +1335,7 @@ static int acpi_thermal_remove(struct acpi_device *device, int type) | |||
1352 | /* deferred task may reinsert timer */ | 1335 | /* deferred task may reinsert timer */ |
1353 | del_timer_sync(&(tz->timer)); | 1336 | del_timer_sync(&(tz->timer)); |
1354 | 1337 | ||
1355 | status = acpi_remove_notify_handler(tz->handle, | 1338 | status = acpi_remove_notify_handler(device->handle, |
1356 | ACPI_DEVICE_NOTIFY, | 1339 | ACPI_DEVICE_NOTIFY, |
1357 | acpi_thermal_notify); | 1340 | acpi_thermal_notify); |
1358 | 1341 | ||
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 1f3ffb353299..56666a982476 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -117,7 +117,7 @@ struct acpi_video_enumerated_device { | |||
117 | }; | 117 | }; |
118 | 118 | ||
119 | struct acpi_video_bus { | 119 | struct acpi_video_bus { |
120 | acpi_handle handle; | 120 | struct acpi_device *device; |
121 | u8 dos_setting; | 121 | u8 dos_setting; |
122 | struct acpi_video_enumerated_device *attached_array; | 122 | struct acpi_video_enumerated_device *attached_array; |
123 | u8 attached_count; | 123 | u8 attached_count; |
@@ -155,7 +155,6 @@ struct acpi_video_device_brightness { | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | struct acpi_video_device { | 157 | struct acpi_video_device { |
158 | acpi_handle handle; | ||
159 | unsigned long device_id; | 158 | unsigned long device_id; |
160 | struct acpi_video_device_flags flags; | 159 | struct acpi_video_device_flags flags; |
161 | struct acpi_video_device_cap cap; | 160 | struct acpi_video_device_cap cap; |
@@ -272,7 +271,8 @@ static int | |||
272 | acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) | 271 | acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) |
273 | { | 272 | { |
274 | int status; | 273 | int status; |
275 | status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state); | 274 | |
275 | status = acpi_evaluate_integer(device->dev->handle, "_DGS", NULL, state); | ||
276 | 276 | ||
277 | return status; | 277 | return status; |
278 | } | 278 | } |
@@ -283,8 +283,7 @@ acpi_video_device_get_state(struct acpi_video_device *device, | |||
283 | { | 283 | { |
284 | int status; | 284 | int status; |
285 | 285 | ||
286 | 286 | status = acpi_evaluate_integer(device->dev->handle, "_DCS", NULL, state); | |
287 | status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state); | ||
288 | 287 | ||
289 | return status; | 288 | return status; |
290 | } | 289 | } |
@@ -299,7 +298,7 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state) | |||
299 | 298 | ||
300 | 299 | ||
301 | arg0.integer.value = state; | 300 | arg0.integer.value = state; |
302 | status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret); | 301 | status = acpi_evaluate_integer(device->dev->handle, "_DSS", &args, &ret); |
303 | 302 | ||
304 | return status; | 303 | return status; |
305 | } | 304 | } |
@@ -315,7 +314,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device, | |||
315 | 314 | ||
316 | *levels = NULL; | 315 | *levels = NULL; |
317 | 316 | ||
318 | status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer); | 317 | status = acpi_evaluate_object(device->dev->handle, "_BCL", NULL, &buffer); |
319 | if (!ACPI_SUCCESS(status)) | 318 | if (!ACPI_SUCCESS(status)) |
320 | return status; | 319 | return status; |
321 | obj = (union acpi_object *)buffer.pointer; | 320 | obj = (union acpi_object *)buffer.pointer; |
@@ -344,7 +343,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) | |||
344 | 343 | ||
345 | 344 | ||
346 | arg0.integer.value = level; | 345 | arg0.integer.value = level; |
347 | status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL); | 346 | status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL); |
348 | 347 | ||
349 | printk(KERN_DEBUG "set_level status: %x\n", status); | 348 | printk(KERN_DEBUG "set_level status: %x\n", status); |
350 | return status; | 349 | return status; |
@@ -356,7 +355,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, | |||
356 | { | 355 | { |
357 | int status; | 356 | int status; |
358 | 357 | ||
359 | status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level); | 358 | status = acpi_evaluate_integer(device->dev->handle, "_BQC", NULL, level); |
360 | 359 | ||
361 | return status; | 360 | return status; |
362 | } | 361 | } |
@@ -383,7 +382,7 @@ acpi_video_device_EDID(struct acpi_video_device *device, | |||
383 | else | 382 | else |
384 | return -EINVAL; | 383 | return -EINVAL; |
385 | 384 | ||
386 | status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer); | 385 | status = acpi_evaluate_object(device->dev->handle, "_DDC", &args, &buffer); |
387 | if (ACPI_FAILURE(status)) | 386 | if (ACPI_FAILURE(status)) |
388 | return -ENODEV; | 387 | return -ENODEV; |
389 | 388 | ||
@@ -413,7 +412,7 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) | |||
413 | 412 | ||
414 | arg0.integer.value = option; | 413 | arg0.integer.value = option; |
415 | 414 | ||
416 | status = acpi_evaluate_integer(video->handle, "_SPD", &args, &tmp); | 415 | status = acpi_evaluate_integer(video->device->handle, "_SPD", &args, &tmp); |
417 | if (ACPI_SUCCESS(status)) | 416 | if (ACPI_SUCCESS(status)) |
418 | status = tmp ? (-EINVAL) : (AE_OK); | 417 | status = tmp ? (-EINVAL) : (AE_OK); |
419 | 418 | ||
@@ -425,8 +424,7 @@ acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id) | |||
425 | { | 424 | { |
426 | int status; | 425 | int status; |
427 | 426 | ||
428 | 427 | status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id); | |
429 | status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id); | ||
430 | 428 | ||
431 | return status; | 429 | return status; |
432 | } | 430 | } |
@@ -437,7 +435,7 @@ acpi_video_bus_POST_options(struct acpi_video_bus *video, | |||
437 | { | 435 | { |
438 | int status; | 436 | int status; |
439 | 437 | ||
440 | status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options); | 438 | status = acpi_evaluate_integer(video->device->handle, "_VPO", NULL, options); |
441 | *options &= 3; | 439 | *options &= 3; |
442 | 440 | ||
443 | return status; | 441 | return status; |
@@ -478,7 +476,7 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) | |||
478 | } | 476 | } |
479 | arg0.integer.value = (lcd_flag << 2) | bios_flag; | 477 | arg0.integer.value = (lcd_flag << 2) | bios_flag; |
480 | video->dos_setting = arg0.integer.value; | 478 | video->dos_setting = arg0.integer.value; |
481 | acpi_evaluate_object(video->handle, "_DOS", &args, NULL); | 479 | acpi_evaluate_object(video->device->handle, "_DOS", &args, NULL); |
482 | 480 | ||
483 | Failed: | 481 | Failed: |
484 | return status; | 482 | return status; |
@@ -506,25 +504,25 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
506 | 504 | ||
507 | memset(&device->cap, 0, 4); | 505 | memset(&device->cap, 0, 4); |
508 | 506 | ||
509 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ADR", &h_dummy1))) { | 507 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) { |
510 | device->cap._ADR = 1; | 508 | device->cap._ADR = 1; |
511 | } | 509 | } |
512 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCL", &h_dummy1))) { | 510 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCL", &h_dummy1))) { |
513 | device->cap._BCL = 1; | 511 | device->cap._BCL = 1; |
514 | } | 512 | } |
515 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCM", &h_dummy1))) { | 513 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCM", &h_dummy1))) { |
516 | device->cap._BCM = 1; | 514 | device->cap._BCM = 1; |
517 | } | 515 | } |
518 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DDC", &h_dummy1))) { | 516 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) { |
519 | device->cap._DDC = 1; | 517 | device->cap._DDC = 1; |
520 | } | 518 | } |
521 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DCS", &h_dummy1))) { | 519 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DCS", &h_dummy1))) { |
522 | device->cap._DCS = 1; | 520 | device->cap._DCS = 1; |
523 | } | 521 | } |
524 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DGS", &h_dummy1))) { | 522 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DGS", &h_dummy1))) { |
525 | device->cap._DGS = 1; | 523 | device->cap._DGS = 1; |
526 | } | 524 | } |
527 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DSS", &h_dummy1))) { | 525 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DSS", &h_dummy1))) { |
528 | device->cap._DSS = 1; | 526 | device->cap._DSS = 1; |
529 | } | 527 | } |
530 | 528 | ||
@@ -588,22 +586,22 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video) | |||
588 | acpi_handle h_dummy1; | 586 | acpi_handle h_dummy1; |
589 | 587 | ||
590 | memset(&video->cap, 0, 4); | 588 | memset(&video->cap, 0, 4); |
591 | if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOS", &h_dummy1))) { | 589 | if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) { |
592 | video->cap._DOS = 1; | 590 | video->cap._DOS = 1; |
593 | } | 591 | } |
594 | if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOD", &h_dummy1))) { | 592 | if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOD", &h_dummy1))) { |
595 | video->cap._DOD = 1; | 593 | video->cap._DOD = 1; |
596 | } | 594 | } |
597 | if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_ROM", &h_dummy1))) { | 595 | if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_ROM", &h_dummy1))) { |
598 | video->cap._ROM = 1; | 596 | video->cap._ROM = 1; |
599 | } | 597 | } |
600 | if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_GPD", &h_dummy1))) { | 598 | if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_GPD", &h_dummy1))) { |
601 | video->cap._GPD = 1; | 599 | video->cap._GPD = 1; |
602 | } | 600 | } |
603 | if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_SPD", &h_dummy1))) { | 601 | if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_SPD", &h_dummy1))) { |
604 | video->cap._SPD = 1; | 602 | video->cap._SPD = 1; |
605 | } | 603 | } |
606 | if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_VPO", &h_dummy1))) { | 604 | if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_VPO", &h_dummy1))) { |
607 | video->cap._VPO = 1; | 605 | video->cap._VPO = 1; |
608 | } | 606 | } |
609 | } | 607 | } |
@@ -1271,7 +1269,6 @@ acpi_video_bus_get_one_device(struct acpi_device *device, | |||
1271 | 1269 | ||
1272 | memset(data, 0, sizeof(struct acpi_video_device)); | 1270 | memset(data, 0, sizeof(struct acpi_video_device)); |
1273 | 1271 | ||
1274 | data->handle = device->handle; | ||
1275 | strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); | 1272 | strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); |
1276 | strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); | 1273 | strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); |
1277 | acpi_driver_data(device) = data; | 1274 | acpi_driver_data(device) = data; |
@@ -1298,7 +1295,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device, | |||
1298 | acpi_video_device_bind(video, data); | 1295 | acpi_video_device_bind(video, data); |
1299 | acpi_video_device_find_cap(data); | 1296 | acpi_video_device_find_cap(data); |
1300 | 1297 | ||
1301 | status = acpi_install_notify_handler(data->handle, | 1298 | status = acpi_install_notify_handler(device->handle, |
1302 | ACPI_DEVICE_NOTIFY, | 1299 | ACPI_DEVICE_NOTIFY, |
1303 | acpi_video_device_notify, | 1300 | acpi_video_device_notify, |
1304 | data); | 1301 | data); |
@@ -1400,8 +1397,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) | |||
1400 | union acpi_object *dod = NULL; | 1397 | union acpi_object *dod = NULL; |
1401 | union acpi_object *obj; | 1398 | union acpi_object *obj; |
1402 | 1399 | ||
1403 | 1400 | status = acpi_evaluate_object(video->device->handle, "_DOD", NULL, &buffer); | |
1404 | status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer); | ||
1405 | if (!ACPI_SUCCESS(status)) { | 1401 | if (!ACPI_SUCCESS(status)) { |
1406 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD")); | 1402 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD")); |
1407 | return status; | 1403 | return status; |
@@ -1569,7 +1565,7 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device) | |||
1569 | up(&video->sem); | 1565 | up(&video->sem); |
1570 | acpi_video_device_remove_fs(device->dev); | 1566 | acpi_video_device_remove_fs(device->dev); |
1571 | 1567 | ||
1572 | status = acpi_remove_notify_handler(device->handle, | 1568 | status = acpi_remove_notify_handler(device->dev->handle, |
1573 | ACPI_DEVICE_NOTIFY, | 1569 | ACPI_DEVICE_NOTIFY, |
1574 | acpi_video_device_notify); | 1570 | acpi_video_device_notify); |
1575 | 1571 | ||
@@ -1624,8 +1620,7 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) | |||
1624 | if (!video) | 1620 | if (!video) |
1625 | return; | 1621 | return; |
1626 | 1622 | ||
1627 | if (acpi_bus_get_device(handle, &device)) | 1623 | device = video->device; |
1628 | return; | ||
1629 | 1624 | ||
1630 | switch (event) { | 1625 | switch (event) { |
1631 | case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur, | 1626 | case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur, |
@@ -1668,8 +1663,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) | |||
1668 | if (!video_device) | 1663 | if (!video_device) |
1669 | return; | 1664 | return; |
1670 | 1665 | ||
1671 | if (acpi_bus_get_device(handle, &device)) | 1666 | device = video_device->dev; |
1672 | return; | ||
1673 | 1667 | ||
1674 | switch (event) { | 1668 | switch (event) { |
1675 | case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */ | 1669 | case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */ |
@@ -1707,7 +1701,7 @@ static int acpi_video_bus_add(struct acpi_device *device) | |||
1707 | return -ENOMEM; | 1701 | return -ENOMEM; |
1708 | memset(video, 0, sizeof(struct acpi_video_bus)); | 1702 | memset(video, 0, sizeof(struct acpi_video_bus)); |
1709 | 1703 | ||
1710 | video->handle = device->handle; | 1704 | video->device = device; |
1711 | strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); | 1705 | strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); |
1712 | strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); | 1706 | strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); |
1713 | acpi_driver_data(device) = video; | 1707 | acpi_driver_data(device) = video; |
@@ -1727,7 +1721,7 @@ static int acpi_video_bus_add(struct acpi_device *device) | |||
1727 | acpi_video_bus_get_devices(video, device); | 1721 | acpi_video_bus_get_devices(video, device); |
1728 | acpi_video_bus_start_devices(video); | 1722 | acpi_video_bus_start_devices(video); |
1729 | 1723 | ||
1730 | status = acpi_install_notify_handler(video->handle, | 1724 | status = acpi_install_notify_handler(device->handle, |
1731 | ACPI_DEVICE_NOTIFY, | 1725 | ACPI_DEVICE_NOTIFY, |
1732 | acpi_video_bus_notify, video); | 1726 | acpi_video_bus_notify, video); |
1733 | if (ACPI_FAILURE(status)) { | 1727 | if (ACPI_FAILURE(status)) { |
@@ -1767,7 +1761,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) | |||
1767 | 1761 | ||
1768 | acpi_video_bus_stop_devices(video); | 1762 | acpi_video_bus_stop_devices(video); |
1769 | 1763 | ||
1770 | status = acpi_remove_notify_handler(video->handle, | 1764 | status = acpi_remove_notify_handler(video->device->handle, |
1771 | ACPI_DEVICE_NOTIFY, | 1765 | ACPI_DEVICE_NOTIFY, |
1772 | acpi_video_bus_notify); | 1766 | acpi_video_bus_notify); |
1773 | 1767 | ||