···6565};66666767struct acpi_ac {6868- acpi_handle handle;6868+ struct acpi_device * device;6969 unsigned long state;7070};7171···8888 if (!ac)8989 return -EINVAL;90909191- status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);9191+ status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state);9292 if (ACPI_FAILURE(status)) {9393 ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));9494 ac->state = ACPI_AC_STATUS_UNKNOWN;···191191 if (!ac)192192 return;193193194194- if (acpi_bus_get_device(ac->handle, &device))195195- return;196196-194194+ device = ac->device;197195 switch (event) {198196 case ACPI_AC_NOTIFY_STATUS:199197 acpi_ac_get_state(ac);···221223 return -ENOMEM;222224 memset(ac, 0, sizeof(struct acpi_ac));223225224224- ac->handle = device->handle;226226+ ac->device = device;225227 strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);226228 strcpy(acpi_device_class(device), ACPI_AC_CLASS);227229 acpi_driver_data(device) = ac;···234236 if (result)235237 goto end;236238237237- status = acpi_install_notify_handler(ac->handle,239239+ status = acpi_install_notify_handler(device->handle,238240 ACPI_DEVICE_NOTIFY, acpi_ac_notify,239241 ac);240242 if (ACPI_FAILURE(status)) {···266268267269 ac = (struct acpi_ac *)acpi_driver_data(device);268270269269- status = acpi_remove_notify_handler(ac->handle,271271+ status = acpi_remove_notify_handler(device->handle,270272 ACPI_DEVICE_NOTIFY, acpi_ac_notify);271273272274 acpi_ac_remove_fs(device);
+7-7
drivers/acpi/acpi_memhotplug.c
···8080};81818282struct acpi_memory_device {8383- acpi_handle handle;8383+ struct acpi_device * device;8484 unsigned int state; /* State of the memory device */8585 struct list_head res_list;8686};···129129 struct acpi_memory_info *info, *n;130130131131132132- status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS,132132+ status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,133133 acpi_memory_get_resource, mem_device);134134 if (ACPI_FAILURE(status)) {135135 list_for_each_entry_safe(info, n, &mem_device->res_list, list)···192192193193194194 /* Get device present/absent information from the _STA */195195- if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",195195+ if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",196196 NULL, ¤t_status)))197197 return -ENODEV;198198 /*···222222 return result;223223 }224224225225- node = acpi_get_node(mem_device->handle);225225+ node = acpi_get_node(mem_device->device->handle);226226 /*227227 * Tell the VM there is more memory here...228228 * Note: Assume that this function returns zero on success···269269 arg_list.pointer = &arg;270270 arg.type = ACPI_TYPE_INTEGER;271271 arg.integer.value = 1;272272- status = acpi_evaluate_object(mem_device->handle,272272+ status = acpi_evaluate_object(mem_device->device->handle,273273 "_EJ0", &arg_list, NULL);274274 /* Return on _EJ0 failure */275275 if (ACPI_FAILURE(status)) {···278278 }279279280280 /* Evalute _STA to check if the device is disabled */281281- status = acpi_evaluate_integer(mem_device->handle, "_STA",281281+ status = acpi_evaluate_integer(mem_device->device->handle, "_STA",282282 NULL, ¤t_status);283283 if (ACPI_FAILURE(status))284284 return -ENODEV;···398398 memset(mem_device, 0, sizeof(struct acpi_memory_device));399399400400 INIT_LIST_HEAD(&mem_device->res_list);401401- mem_device->handle = device->handle;401401+ mem_device->device = device;402402 sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);403403 sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);404404 acpi_driver_data(device) = mem_device;
+10-13
drivers/acpi/battery.c
···108108};109109110110struct acpi_battery {111111- acpi_handle handle;111111+ struct acpi_device * device;112112 struct acpi_battery_flags flags;113113 struct acpi_battery_trips trips;114114 unsigned long alarm;···138138139139 /* Evalute _BIF */140140141141- status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);141141+ status = acpi_evaluate_object(battery->device->handle, "_BIF", NULL, &buffer);142142 if (ACPI_FAILURE(status)) {143143 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));144144 return -ENODEV;···198198199199 /* Evalute _BST */200200201201- status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);201201+ status = acpi_evaluate_object(battery->device->handle, "_BST", NULL, &buffer);202202 if (ACPI_FAILURE(status)) {203203 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));204204 return -ENODEV;···255255256256 arg0.integer.value = alarm;257257258258- status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL);258258+ status = acpi_evaluate_object(battery->device->handle, "_BTP", &arg_list, NULL);259259 if (ACPI_FAILURE(status))260260 return -ENODEV;261261···278278 if (!battery)279279 return -EINVAL;280280281281- result = acpi_bus_get_device(battery->handle, &device);282282- if (result)283283- return result;281281+ device = battery->device;284282285283 result = acpi_bus_get_status(device);286284 if (result)···303305304306 /* See if alarms are supported, and if so, set default */305307306306- status = acpi_get_handle(battery->handle, "_BTP", &handle);308308+ status = acpi_get_handle(battery->device->handle, "_BTP", &handle);307309 if (ACPI_SUCCESS(status)) {308310 battery->flags.alarm = 1;309311 acpi_battery_set_alarm(battery, battery->trips.warning);···660662 if (!battery)661663 return;662664663663- if (acpi_bus_get_device(handle, &device))664664- return;665665+ device = battery->device;665666666667 switch (event) {667668 case ACPI_BATTERY_NOTIFY_STATUS:···692695 return -ENOMEM;693696 memset(battery, 0, sizeof(struct acpi_battery));694697695695- battery->handle = device->handle;698698+ battery->device = device;696699 strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);697700 strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);698701 acpi_driver_data(device) = battery;···705708 if (result)706709 goto end;707710708708- status = acpi_install_notify_handler(battery->handle,711711+ status = acpi_install_notify_handler(device->handle,709712 ACPI_DEVICE_NOTIFY,710713 acpi_battery_notify, battery);711714 if (ACPI_FAILURE(status)) {···737740738741 battery = (struct acpi_battery *)acpi_driver_data(device);739742740740- status = acpi_remove_notify_handler(battery->handle,743743+ status = acpi_remove_notify_handler(device->handle,741744 ACPI_DEVICE_NOTIFY,742745 acpi_battery_notify);743746
+4-6
drivers/acpi/button.c
···8282};83838484struct acpi_button {8585- acpi_handle handle;8685 struct acpi_device *device; /* Fixed button kludge */8786 u8 type;8887 unsigned long pushed;···136137 if (!button || !button->device)137138 return 0;138139139139- status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state);140140+ status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state);140141 if (ACPI_FAILURE(status)) {141142 seq_printf(seq, "state: unsupported\n");142143 } else {···281282 if (!button)282283 return AE_BAD_PARAMETER;283284284284- acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button);285285+ acpi_button_notify(button->device->handle, ACPI_BUTTON_NOTIFY_STATUS, button);285286286287 return AE_OK;287288}···302303 memset(button, 0, sizeof(struct acpi_button));303304304305 button->device = device;305305- button->handle = device->handle;306306 acpi_driver_data(device) = button;307307308308 /*···360362 button);361363 break;362364 default:363363- status = acpi_install_notify_handler(button->handle,365365+ status = acpi_install_notify_handler(device->handle,364366 ACPI_DEVICE_NOTIFY,365367 acpi_button_notify,366368 button);···418420 acpi_button_notify_fixed);419421 break;420422 default:421421- status = acpi_remove_notify_handler(button->handle,423423+ status = acpi_remove_notify_handler(device->handle,422424 ACPI_DEVICE_NOTIFY,423425 acpi_button_notify);424426 break;
+5-5
drivers/acpi/fan.c
···6464};65656666struct acpi_fan {6767- acpi_handle handle;6767+ struct acpi_device * device;6868};69697070/* --------------------------------------------------------------------------···808081818282 if (fan) {8383- if (acpi_bus_get_power(fan->handle, &state))8383+ if (acpi_bus_get_power(fan->device->handle, &state))8484 seq_printf(seq, "status: ERROR\n");8585 else8686 seq_printf(seq, "status: %s\n",···112112113113 state_string[count] = '\0';114114115115- result = acpi_bus_set_power(fan->handle,115115+ result = acpi_bus_set_power(fan->device->handle,116116 simple_strtoul(state_string, NULL, 0));117117 if (result)118118 return result;···191191 return -ENOMEM;192192 memset(fan, 0, sizeof(struct acpi_fan));193193194194- fan->handle = device->handle;194194+ fan->device = device;195195 strcpy(acpi_device_name(device), "Fan");196196 strcpy(acpi_device_class(device), ACPI_FAN_CLASS);197197 acpi_driver_data(device) = fan;198198199199- result = acpi_bus_get_power(fan->handle, &state);199199+ result = acpi_bus_get_power(device->handle, &state);200200 if (result) {201201 printk(KERN_ERR PREFIX "Reading power state\n");202202 goto end;
+6-9
drivers/acpi/pci_link.c
···8383struct acpi_pci_link {8484 struct list_head node;8585 struct acpi_device *device;8686- acpi_handle handle;8786 struct acpi_pci_link_irq irq;8887 int refcnt;8988};···174175 if (!link)175176 return -EINVAL;176177177177- status = acpi_walk_resources(link->handle, METHOD_NAME__PRS,178178+ status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS,178179 acpi_pci_link_check_possible, link);179180 if (ACPI_FAILURE(status)) {180181 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));···248249 acpi_status status = AE_OK;249250 int irq = 0;250251251251-252252- if (!link || !link->handle)252252+ if (!link)253253 return -EINVAL;254254255255 link->irq.active = 0;···272274 * Query and parse _CRS to get the current IRQ assignment. 273275 */274276275275- status = acpi_walk_resources(link->handle, METHOD_NAME__CRS,277277+ status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS,276278 acpi_pci_link_check_current, &irq);277279 if (ACPI_FAILURE(status)) {278280 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));···358360 resource->end.type = ACPI_RESOURCE_TYPE_END_TAG;359361360362 /* Attempt to set the resource */361361- status = acpi_set_current_resources(link->handle, &buffer);363363+ status = acpi_set_current_resources(link->device->handle, &buffer);362364363365 /* check for total failure */364366 if (ACPI_FAILURE(status)) {···697699 acpi_device_bid(link->device)));698700699701 if (link->refcnt == 0) {700700- acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);702702+ acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL);701703 }702704 mutex_unlock(&acpi_link_lock);703705 return (link->irq.active);···724726 memset(link, 0, sizeof(struct acpi_pci_link));725727726728 link->device = device;727727- link->handle = device->handle;728729 strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME);729730 strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);730731 acpi_driver_data(device) = link;···762765763766 end:764767 /* disable all links -- to be activated on use */765765- acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);768768+ acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL);766769 mutex_unlock(&acpi_link_lock);767770768771 if (result)
+10-10
drivers/acpi/pci_root.c
···58585959struct acpi_pci_root {6060 struct list_head node;6161- acpi_handle handle;6161+ struct acpi_device * device;6262 struct acpi_pci_id id;6363 struct pci_bus *bus;6464};···8383 list_for_each(entry, &acpi_pci_roots) {8484 struct acpi_pci_root *root;8585 root = list_entry(entry, struct acpi_pci_root, node);8686- driver->add(root->handle);8686+ driver->add(root->device->handle);8787 n++;8888 }8989···110110 list_for_each(entry, &acpi_pci_roots) {111111 struct acpi_pci_root *root;112112 root = list_entry(entry, struct acpi_pci_root, node);113113- driver->remove(root->handle);113113+ driver->remove(root->device->handle);114114 }115115}116116···170170 memset(root, 0, sizeof(struct acpi_pci_root));171171 INIT_LIST_HEAD(&root->node);172172173173- root->handle = device->handle;173173+ root->device = device;174174 strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME);175175 strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS);176176 acpi_driver_data(device) = root;···185185 * -------186186 * Obtained via _SEG, if exists, otherwise assumed to be zero (0).187187 */188188- status = acpi_evaluate_integer(root->handle, METHOD_NAME__SEG, NULL,188188+ status = acpi_evaluate_integer(device->handle, METHOD_NAME__SEG, NULL,189189 &value);190190 switch (status) {191191 case AE_OK:···207207 * ---208208 * Obtained via _BBN, if exists, otherwise assumed to be zero (0).209209 */210210- status = acpi_evaluate_integer(root->handle, METHOD_NAME__BBN, NULL,210210+ status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL,211211 &value);212212 switch (status) {213213 case AE_OK:···234234 "Wrong _BBN value, reboot"235235 " and use option 'pci=noacpi'\n");236236237237- status = try_get_root_bridge_busnr(root->handle, &bus);237237+ status = try_get_root_bridge_busnr(device->handle, &bus);238238 if (ACPI_FAILURE(status))239239 break;240240 if (bus != root->id.bus) {···294294 * -----------------295295 * Evaluate and parse _PRT, if exists.296296 */297297- status = acpi_get_handle(root->handle, METHOD_NAME__PRT, &handle);297297+ status = acpi_get_handle(device->handle, METHOD_NAME__PRT, &handle);298298 if (ACPI_SUCCESS(status))299299- result = acpi_pci_irq_add_prt(root->handle, root->id.segment,299299+ result = acpi_pci_irq_add_prt(device->handle, root->id.segment,300300 root->id.bus);301301302302 end:···315315316316317317 list_for_each_entry(root, &acpi_pci_roots, node) {318318- if (root->handle == device->handle) {318318+ if (root->device == device) {319319 pci_bus_add_devices(root->bus);320320 return 0;321321 }
+9-13
drivers/acpi/power.c
···7070};71717272struct acpi_power_resource {7373- acpi_handle handle;7373+ struct acpi_device * device;7474 acpi_bus_id name;7575 u32 system_level;7676 u32 order;···124124 if (!resource)125125 return -EINVAL;126126127127- status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta);127127+ status = acpi_evaluate_integer(resource->device->handle, "_STA", NULL, &sta);128128 if (ACPI_FAILURE(status))129129 return -ENODEV;130130···192192 return 0;193193 }194194195195- status = acpi_evaluate_object(resource->handle, "_ON", NULL, NULL);195195+ status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL);196196 if (ACPI_FAILURE(status))197197 return -ENODEV;198198···203203 return -ENOEXEC;204204205205 /* Update the power resource's _device_ power state */206206- result = acpi_bus_get_device(resource->handle, &device);207207- if (result)208208- return result;209209- device->power.state = ACPI_STATE_D0;206206+ device = resource->device;207207+ resource->device->power.state = ACPI_STATE_D0;210208211209 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n",212210 resource->name));···240242 return 0;241243 }242244243243- status = acpi_evaluate_object(resource->handle, "_OFF", NULL, NULL);245245+ status = acpi_evaluate_object(resource->device->handle, "_OFF", NULL, NULL);244246 if (ACPI_FAILURE(status))245247 return -ENODEV;246248···251253 return -ENOEXEC;252254253255 /* Update the power resource's _device_ power state */254254- result = acpi_bus_get_device(resource->handle, &device);255255- if (result)256256- return result;256256+ device = resource->device;257257 device->power.state = ACPI_STATE_D3;258258259259 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n",···540544 return -ENOMEM;541545 memset(resource, 0, sizeof(struct acpi_power_resource));542546543543- resource->handle = device->handle;547547+ resource->device = device;544548 strcpy(resource->name, device->pnp.bus_id);545549 strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);546550 strcpy(acpi_device_class(device), ACPI_POWER_CLASS);547551 acpi_driver_data(device) = resource;548552549553 /* Evalute the object to get the system level and resource order. */550550- status = acpi_evaluate_object(resource->handle, NULL, NULL, &buffer);554554+ status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer);551555 if (ACPI_FAILURE(status)) {552556 result = -ENODEV;553557 goto end;
+20-37
drivers/acpi/thermal.c
···162162};163163164164struct acpi_thermal {165165- acpi_handle handle;165165+ struct acpi_device * device;166166 acpi_bus_id name;167167 unsigned long temperature;168168 unsigned long last_temperature;···229229 tz->last_temperature = tz->temperature;230230231231 status =232232- acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature);232232+ acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tz->temperature);233233 if (ACPI_FAILURE(status))234234 return -ENODEV;235235···248248 return -EINVAL;249249250250 status =251251- acpi_evaluate_integer(tz->handle, "_TZP", NULL,251251+ acpi_evaluate_integer(tz->device->handle, "_TZP", NULL,252252 &tz->polling_frequency);253253 if (ACPI_FAILURE(status))254254 return -ENODEV;···285285 if (!tz)286286 return -EINVAL;287287288288- status = acpi_get_handle(tz->handle, "_SCP", &handle);288288+ status = acpi_get_handle(tz->device->handle, "_SCP", &handle);289289 if (ACPI_FAILURE(status)) {290290 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n"));291291 return -ENODEV;···316316317317 /* Critical Shutdown (required) */318318319319- status = acpi_evaluate_integer(tz->handle, "_CRT", NULL,319319+ status = acpi_evaluate_integer(tz->device->handle, "_CRT", NULL,320320 &tz->trips.critical.temperature);321321 if (ACPI_FAILURE(status)) {322322 tz->trips.critical.flags.valid = 0;···332332 /* Critical Sleep (optional) */333333334334 status =335335- acpi_evaluate_integer(tz->handle, "_HOT", NULL,335335+ acpi_evaluate_integer(tz->device->handle, "_HOT", NULL,336336 &tz->trips.hot.temperature);337337 if (ACPI_FAILURE(status)) {338338 tz->trips.hot.flags.valid = 0;···346346 /* Passive: Processors (optional) */347347348348 status =349349- acpi_evaluate_integer(tz->handle, "_PSV", NULL,349349+ acpi_evaluate_integer(tz->device->handle, "_PSV", NULL,350350 &tz->trips.passive.temperature);351351 if (ACPI_FAILURE(status)) {352352 tz->trips.passive.flags.valid = 0;···355355 tz->trips.passive.flags.valid = 1;356356357357 status =358358- acpi_evaluate_integer(tz->handle, "_TC1", NULL,358358+ acpi_evaluate_integer(tz->device->handle, "_TC1", NULL,359359 &tz->trips.passive.tc1);360360 if (ACPI_FAILURE(status))361361 tz->trips.passive.flags.valid = 0;362362363363 status =364364- acpi_evaluate_integer(tz->handle, "_TC2", NULL,364364+ acpi_evaluate_integer(tz->device->handle, "_TC2", NULL,365365 &tz->trips.passive.tc2);366366 if (ACPI_FAILURE(status))367367 tz->trips.passive.flags.valid = 0;368368369369 status =370370- acpi_evaluate_integer(tz->handle, "_TSP", NULL,370370+ acpi_evaluate_integer(tz->device->handle, "_TSP", NULL,371371 &tz->trips.passive.tsp);372372 if (ACPI_FAILURE(status))373373 tz->trips.passive.flags.valid = 0;374374375375 status =376376- acpi_evaluate_reference(tz->handle, "_PSL", NULL,376376+ acpi_evaluate_reference(tz->device->handle, "_PSL", NULL,377377 &tz->trips.passive.devices);378378 if (ACPI_FAILURE(status))379379 tz->trips.passive.flags.valid = 0;···393393 char name[5] = { '_', 'A', 'C', ('0' + i), '\0' };394394395395 status =396396- acpi_evaluate_integer(tz->handle, name, NULL,396396+ acpi_evaluate_integer(tz->device->handle, name, NULL,397397 &tz->trips.active[i].temperature);398398 if (ACPI_FAILURE(status))399399 break;400400401401 name[2] = 'L';402402 status =403403- acpi_evaluate_reference(tz->handle, name, NULL,403403+ acpi_evaluate_reference(tz->device->handle, name, NULL,404404 &tz->trips.active[i].devices);405405 if (ACPI_SUCCESS(status)) {406406 tz->trips.active[i].flags.valid = 1;···424424 return -EINVAL;425425426426 status =427427- acpi_evaluate_reference(tz->handle, "_TZD", NULL, &tz->devices);427427+ acpi_evaluate_reference(tz->device->handle, "_TZD", NULL, &tz->devices);428428 if (ACPI_FAILURE(status))429429 return -ENODEV;430430···453453454454static int acpi_thermal_critical(struct acpi_thermal *tz)455455{456456- int result = 0;457457- struct acpi_device *device = NULL;458458-459459-460456 if (!tz || !tz->trips.critical.flags.valid)461457 return -EINVAL;462458···462466 } else if (tz->trips.critical.flags.enabled)463467 tz->trips.critical.flags.enabled = 0;464468465465- result = acpi_bus_get_device(tz->handle, &device);466466- if (result)467467- return result;468468-469469 printk(KERN_EMERG470470 "Critical temperature reached (%ld C), shutting down.\n",471471 KELVIN_TO_CELSIUS(tz->temperature));472472- acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL,472472+ acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,473473 tz->trips.critical.flags.enabled);474474475475 acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);···475483476484static int acpi_thermal_hot(struct acpi_thermal *tz)477485{478478- int result = 0;479479- struct acpi_device *device = NULL;480480-481481-482486 if (!tz || !tz->trips.hot.flags.valid)483487 return -EINVAL;484488···484496 } else if (tz->trips.hot.flags.enabled)485497 tz->trips.hot.flags.enabled = 0;486498487487- result = acpi_bus_get_device(tz->handle, &device);488488- if (result)489489- return result;490490-491491- acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_HOT,499499+ acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,492500 tz->trips.hot.flags.enabled);493501494502 /* TBD: Call user-mode "sleep(S4)" function */···11771193 if (!tz)11781194 return;1179119511801180- if (acpi_bus_get_device(tz->handle, &device))11811181- return;11961196+ device = tz->device;1182119711831198 switch (event) {11841199 case ACPI_THERMAL_NOTIFY_TEMPERATURE:···12761293 return -ENOMEM;12771294 memset(tz, 0, sizeof(struct acpi_thermal));1278129512791279- tz->handle = device->handle;12961296+ tz->device = device;12801297 strcpy(tz->name, device->pnp.bus_id);12811298 strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);12821299 strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);···1294131112951312 acpi_thermal_check(tz);1296131312971297- status = acpi_install_notify_handler(tz->handle,13141314+ status = acpi_install_notify_handler(device->handle,12981315 ACPI_DEVICE_NOTIFY,12991316 acpi_thermal_notify, tz);13001317 if (ACPI_FAILURE(status)) {···13351352 /* deferred task may reinsert timer */13361353 del_timer_sync(&(tz->timer));1337135413381338- status = acpi_remove_notify_handler(tz->handle,13551355+ status = acpi_remove_notify_handler(device->handle,13391356 ACPI_DEVICE_NOTIFY,13401357 acpi_thermal_notify);13411358
+34-40
drivers/acpi/video.c
···117117};118118119119struct acpi_video_bus {120120- acpi_handle handle;120120+ struct acpi_device *device;121121 u8 dos_setting;122122 struct acpi_video_enumerated_device *attached_array;123123 u8 attached_count;···155155};156156157157struct acpi_video_device {158158- acpi_handle handle;159158 unsigned long device_id;160159 struct acpi_video_device_flags flags;161160 struct acpi_video_device_cap cap;···271272acpi_video_device_query(struct acpi_video_device *device, unsigned long *state)272273{273274 int status;274274- status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state);275275+276276+ status = acpi_evaluate_integer(device->dev->handle, "_DGS", NULL, state);275277276278 return status;277279}···283283{284284 int status;285285286286-287287- status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state);286286+ status = acpi_evaluate_integer(device->dev->handle, "_DCS", NULL, state);288287289288 return status;290289}···298299299300300301 arg0.integer.value = state;301301- status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret);302302+ status = acpi_evaluate_integer(device->dev->handle, "_DSS", &args, &ret);302303303304 return status;304305}···314315315316 *levels = NULL;316317317317- status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer);318318+ status = acpi_evaluate_object(device->dev->handle, "_BCL", NULL, &buffer);318319 if (!ACPI_SUCCESS(status))319320 return status;320321 obj = (union acpi_object *)buffer.pointer;···343344344345345346 arg0.integer.value = level;346346- status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL);347347+ status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL);347348348349 printk(KERN_DEBUG "set_level status: %x\n", status);349350 return status;···355356{356357 int status;357358358358- status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level);359359+ status = acpi_evaluate_integer(device->dev->handle, "_BQC", NULL, level);359360360361 return status;361362}···382383 else383384 return -EINVAL;384385385385- status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer);386386+ status = acpi_evaluate_object(device->dev->handle, "_DDC", &args, &buffer);386387 if (ACPI_FAILURE(status))387388 return -ENODEV;388389···412413413414 arg0.integer.value = option;414415415415- status = acpi_evaluate_integer(video->handle, "_SPD", &args, &tmp);416416+ status = acpi_evaluate_integer(video->device->handle, "_SPD", &args, &tmp);416417 if (ACPI_SUCCESS(status))417418 status = tmp ? (-EINVAL) : (AE_OK);418419···424425{425426 int status;426427427427-428428- status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id);428428+ status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id);429429430430 return status;431431}···435437{436438 int status;437439438438- status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options);440440+ status = acpi_evaluate_integer(video->device->handle, "_VPO", NULL, options);439441 *options &= 3;440442441443 return status;···476478 }477479 arg0.integer.value = (lcd_flag << 2) | bios_flag;478480 video->dos_setting = arg0.integer.value;479479- acpi_evaluate_object(video->handle, "_DOS", &args, NULL);481481+ acpi_evaluate_object(video->device->handle, "_DOS", &args, NULL);480482481483 Failed:482484 return status;···504506505507 memset(&device->cap, 0, 4);506508507507- if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ADR", &h_dummy1))) {509509+ if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) {508510 device->cap._ADR = 1;509511 }510510- if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCL", &h_dummy1))) {512512+ if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCL", &h_dummy1))) {511513 device->cap._BCL = 1;512514 }513513- if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCM", &h_dummy1))) {515515+ if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCM", &h_dummy1))) {514516 device->cap._BCM = 1;515517 }516516- if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DDC", &h_dummy1))) {518518+ if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) {517519 device->cap._DDC = 1;518520 }519519- if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DCS", &h_dummy1))) {521521+ if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DCS", &h_dummy1))) {520522 device->cap._DCS = 1;521523 }522522- if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DGS", &h_dummy1))) {524524+ if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DGS", &h_dummy1))) {523525 device->cap._DGS = 1;524526 }525525- if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DSS", &h_dummy1))) {527527+ if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DSS", &h_dummy1))) {526528 device->cap._DSS = 1;527529 }528530···586588 acpi_handle h_dummy1;587589588590 memset(&video->cap, 0, 4);589589- if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOS", &h_dummy1))) {591591+ if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) {590592 video->cap._DOS = 1;591593 }592592- if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOD", &h_dummy1))) {594594+ if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOD", &h_dummy1))) {593595 video->cap._DOD = 1;594596 }595595- if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_ROM", &h_dummy1))) {597597+ if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_ROM", &h_dummy1))) {596598 video->cap._ROM = 1;597599 }598598- if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_GPD", &h_dummy1))) {600600+ if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_GPD", &h_dummy1))) {599601 video->cap._GPD = 1;600602 }601601- if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_SPD", &h_dummy1))) {603603+ if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_SPD", &h_dummy1))) {602604 video->cap._SPD = 1;603605 }604604- if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_VPO", &h_dummy1))) {606606+ if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_VPO", &h_dummy1))) {605607 video->cap._VPO = 1;606608 }607609}···1269127112701272 memset(data, 0, sizeof(struct acpi_video_device));1271127312721272- data->handle = device->handle;12731274 strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);12741275 strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);12751276 acpi_driver_data(device) = data;···12951298 acpi_video_device_bind(video, data);12961299 acpi_video_device_find_cap(data);1297130012981298- status = acpi_install_notify_handler(data->handle,13011301+ status = acpi_install_notify_handler(device->handle,12991302 ACPI_DEVICE_NOTIFY,13001303 acpi_video_device_notify,13011304 data);···13971400 union acpi_object *dod = NULL;13981401 union acpi_object *obj;1399140214001400-14011401- status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer);14031403+ status = acpi_evaluate_object(video->device->handle, "_DOD", NULL, &buffer);14021404 if (!ACPI_SUCCESS(status)) {14031405 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD"));14041406 return status;···15651569 up(&video->sem);15661570 acpi_video_device_remove_fs(device->dev);1567157115681568- status = acpi_remove_notify_handler(device->handle,15721572+ status = acpi_remove_notify_handler(device->dev->handle,15691573 ACPI_DEVICE_NOTIFY,15701574 acpi_video_device_notify);15711575···16201624 if (!video)16211625 return;1622162616231623- if (acpi_bus_get_device(handle, &device))16241624- return;16271627+ device = video->device;1625162816261629 switch (event) {16271630 case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur,···16631668 if (!video_device)16641669 return;1665167016661666- if (acpi_bus_get_device(handle, &device))16671667- return;16711671+ device = video_device->dev;1668167216691673 switch (event) {16701674 case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */···17011707 return -ENOMEM;17021708 memset(video, 0, sizeof(struct acpi_video_bus));1703170917041704- video->handle = device->handle;17101710+ video->device = device;17051711 strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);17061712 strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);17071713 acpi_driver_data(device) = video;···17211727 acpi_video_bus_get_devices(video, device);17221728 acpi_video_bus_start_devices(video);1723172917241724- status = acpi_install_notify_handler(video->handle,17301730+ status = acpi_install_notify_handler(device->handle,17251731 ACPI_DEVICE_NOTIFY,17261732 acpi_video_bus_notify, video);17271733 if (ACPI_FAILURE(status)) {···1761176717621768 acpi_video_bus_stop_devices(video);1763176917641764- status = acpi_remove_notify_handler(video->handle,17701770+ status = acpi_remove_notify_handler(video->device->handle,17651771 ACPI_DEVICE_NOTIFY,17661772 acpi_video_bus_notify);17671773