Pull style into test branch

Conflicts:

drivers/acpi/button.c
drivers/acpi/ec.c
drivers/acpi/osl.c
drivers/acpi/sbs.c

Len Brown cece9014 cfee47f9

+128 -134
+3 -3
drivers/acpi/ac.c
··· 109 110 static int acpi_ac_seq_show(struct seq_file *seq, void *offset) 111 { 112 - struct acpi_ac *ac = (struct acpi_ac *)seq->private; 113 114 115 if (!ac) ··· 187 188 static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) 189 { 190 - struct acpi_ac *ac = (struct acpi_ac *)data; 191 struct acpi_device *device = NULL; 192 193 ··· 269 if (!device || !acpi_driver_data(device)) 270 return -EINVAL; 271 272 - ac = (struct acpi_ac *)acpi_driver_data(device); 273 274 status = acpi_remove_notify_handler(device->handle, 275 ACPI_ALL_NOTIFY, acpi_ac_notify);
··· 109 110 static int acpi_ac_seq_show(struct seq_file *seq, void *offset) 111 { 112 + struct acpi_ac *ac = seq->private; 113 114 115 if (!ac) ··· 187 188 static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) 189 { 190 + struct acpi_ac *ac = data; 191 struct acpi_device *device = NULL; 192 193 ··· 269 if (!device || !acpi_driver_data(device)) 270 return -EINVAL; 271 272 + ac = acpi_driver_data(device); 273 274 status = acpi_remove_notify_handler(device->handle, 275 ACPI_ALL_NOTIFY, acpi_ac_notify);
+1 -1
drivers/acpi/acpi_memhotplug.c
··· 429 if (!device || !acpi_driver_data(device)) 430 return -EINVAL; 431 432 - mem_device = (struct acpi_memory_device *)acpi_driver_data(device); 433 kfree(mem_device); 434 435 return 0;
··· 429 if (!device || !acpi_driver_data(device)) 430 return -EINVAL; 431 432 + mem_device = acpi_driver_data(device); 433 kfree(mem_device); 434 435 return 0;
+3 -4
drivers/acpi/asus_acpi.c
··· 1146 if (ACPI_FAILURE(status)) 1147 printk(KERN_WARNING " Couldn't get the DSDT table header\n"); 1148 else 1149 - asus_info = (struct acpi_table_header *)dsdt.pointer; 1150 1151 /* We have to write 0 on init this far for all ASUS models */ 1152 if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) { ··· 1168 * asus_model_match() and try something completely different. 1169 */ 1170 if (buffer.pointer) { 1171 - model = (union acpi_object *)buffer.pointer; 1172 switch (model->type) { 1173 case ACPI_TYPE_STRING: 1174 string = model->string.pointer; ··· 1264 printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n", 1265 ASUS_ACPI_VERSION); 1266 1267 - hotk = 1268 - (struct asus_hotk *)kmalloc(sizeof(struct asus_hotk), GFP_KERNEL); 1269 if (!hotk) 1270 return -ENOMEM; 1271 memset(hotk, 0, sizeof(struct asus_hotk));
··· 1146 if (ACPI_FAILURE(status)) 1147 printk(KERN_WARNING " Couldn't get the DSDT table header\n"); 1148 else 1149 + asus_info = dsdt.pointer; 1150 1151 /* We have to write 0 on init this far for all ASUS models */ 1152 if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) { ··· 1168 * asus_model_match() and try something completely different. 1169 */ 1170 if (buffer.pointer) { 1171 + model = buffer.pointer; 1172 switch (model->type) { 1173 case ACPI_TYPE_STRING: 1174 string = model->string.pointer; ··· 1264 printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n", 1265 ASUS_ACPI_VERSION); 1266 1267 + hotk = kmalloc(sizeof(struct asus_hotk), GFP_KERNEL); 1268 if (!hotk) 1269 return -ENOMEM; 1270 memset(hotk, 0, sizeof(struct asus_hotk));
+11 -11
drivers/acpi/battery.c
··· 149 return -ENODEV; 150 } 151 152 - package = (union acpi_object *)buffer.pointer; 153 154 /* Extract Package Data */ 155 ··· 179 kfree(buffer.pointer); 180 181 if (!result) 182 - (*bif) = (struct acpi_battery_info *)data.pointer; 183 184 return result; 185 } ··· 209 return -ENODEV; 210 } 211 212 - package = (union acpi_object *)buffer.pointer; 213 214 /* Extract Package Data */ 215 ··· 239 kfree(buffer.pointer); 240 241 if (!result) 242 - (*bst) = (struct acpi_battery_status *)data.pointer; 243 244 return result; 245 } ··· 334 static int acpi_battery_read_info(struct seq_file *seq, void *offset) 335 { 336 int result = 0; 337 - struct acpi_battery *battery = (struct acpi_battery *)seq->private; 338 struct acpi_battery_info *bif = NULL; 339 char *units = "?"; 340 ··· 418 static int acpi_battery_read_state(struct seq_file *seq, void *offset) 419 { 420 int result = 0; 421 - struct acpi_battery *battery = (struct acpi_battery *)seq->private; 422 struct acpi_battery_status *bst = NULL; 423 char *units = "?"; 424 ··· 494 495 static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) 496 { 497 - struct acpi_battery *battery = (struct acpi_battery *)seq->private; 498 char *units = "?"; 499 500 ··· 531 { 532 int result = 0; 533 char alarm_string[12] = { '\0' }; 534 - struct seq_file *m = (struct seq_file *)file->private_data; 535 - struct acpi_battery *battery = (struct acpi_battery *)m->private; 536 537 538 if (!battery || (count > sizeof(alarm_string) - 1)) ··· 658 659 static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) 660 { 661 - struct acpi_battery *battery = (struct acpi_battery *)data; 662 struct acpi_device *device = NULL; 663 664 ··· 742 if (!device || !acpi_driver_data(device)) 743 return -EINVAL; 744 745 - battery = (struct acpi_battery *)acpi_driver_data(device); 746 747 status = acpi_remove_notify_handler(device->handle, 748 ACPI_ALL_NOTIFY,
··· 149 return -ENODEV; 150 } 151 152 + package = buffer.pointer; 153 154 /* Extract Package Data */ 155 ··· 179 kfree(buffer.pointer); 180 181 if (!result) 182 + (*bif) = data.pointer; 183 184 return result; 185 } ··· 209 return -ENODEV; 210 } 211 212 + package = buffer.pointer; 213 214 /* Extract Package Data */ 215 ··· 239 kfree(buffer.pointer); 240 241 if (!result) 242 + (*bst) = data.pointer; 243 244 return result; 245 } ··· 334 static int acpi_battery_read_info(struct seq_file *seq, void *offset) 335 { 336 int result = 0; 337 + struct acpi_battery *battery = seq->private; 338 struct acpi_battery_info *bif = NULL; 339 char *units = "?"; 340 ··· 418 static int acpi_battery_read_state(struct seq_file *seq, void *offset) 419 { 420 int result = 0; 421 + struct acpi_battery *battery = seq->private; 422 struct acpi_battery_status *bst = NULL; 423 char *units = "?"; 424 ··· 494 495 static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) 496 { 497 + struct acpi_battery *battery = seq->private; 498 char *units = "?"; 499 500 ··· 531 { 532 int result = 0; 533 char alarm_string[12] = { '\0' }; 534 + struct seq_file *m = file->private_data; 535 + struct acpi_battery *battery = m->private; 536 537 538 if (!battery || (count > sizeof(alarm_string) - 1)) ··· 658 659 static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) 660 { 661 + struct acpi_battery *battery = data; 662 struct acpi_device *device = NULL; 663 664 ··· 742 if (!device || !acpi_driver_data(device)) 743 return -EINVAL; 744 745 + battery = acpi_driver_data(device); 746 747 status = acpi_remove_notify_handler(device->handle, 748 ACPI_ALL_NOTIFY,
+1 -1
drivers/acpi/container.c
··· 117 acpi_status status = AE_OK; 118 struct acpi_container *pc = NULL; 119 120 - pc = (struct acpi_container *)acpi_driver_data(device); 121 kfree(pc); 122 return status; 123 }
··· 117 acpi_status status = AE_OK; 118 struct acpi_container *pc = NULL; 119 120 + pc = acpi_driver_data(device); 121 kfree(pc); 122 return status; 123 }
+3 -3
drivers/acpi/dock.c
··· 565 */ 566 static void dock_notify(acpi_handle handle, u32 event, void *data) 567 { 568 - struct dock_station *ds = (struct dock_station *)data; 569 570 switch (event) { 571 case ACPI_NOTIFY_BUS_CHECK: ··· 616 { 617 acpi_status status; 618 acpi_handle tmp; 619 - struct dock_station *ds = (struct dock_station *)context; 620 struct dock_dependent_device *dd; 621 622 status = acpi_bus_get_ejd(handle, &tmp); ··· 792 static acpi_status 793 find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) 794 { 795 - int *count = (int *)context; 796 acpi_status status = AE_OK; 797 798 if (is_dock(handle)) {
··· 565 */ 566 static void dock_notify(acpi_handle handle, u32 event, void *data) 567 { 568 + struct dock_station *ds = data; 569 570 switch (event) { 571 case ACPI_NOTIFY_BUS_CHECK: ··· 616 { 617 acpi_status status; 618 acpi_handle tmp; 619 + struct dock_station *ds = context; 620 struct dock_dependent_device *dd; 621 622 status = acpi_bus_get_ejd(handle, &tmp); ··· 792 static acpi_status 793 find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) 794 { 795 + int *count = context; 796 acpi_status status = AE_OK; 797 798 if (is_dock(handle)) {
+3 -3
drivers/acpi/fan.c
··· 99 size_t count, loff_t * ppos) 100 { 101 int result = 0; 102 - struct seq_file *m = (struct seq_file *)file->private_data; 103 - struct acpi_fan *fan = (struct acpi_fan *)m->private; 104 char state_string[12] = { '\0' }; 105 106 ··· 229 if (!device || !acpi_driver_data(device)) 230 return -EINVAL; 231 232 - fan = (struct acpi_fan *)acpi_driver_data(device); 233 234 acpi_fan_remove_fs(device); 235
··· 99 size_t count, loff_t * ppos) 100 { 101 int result = 0; 102 + struct seq_file *m = file->private_data; 103 + struct acpi_fan *fan = m->private; 104 char state_string[12] = { '\0' }; 105 106 ··· 229 if (!device || !acpi_driver_data(device)) 230 return -EINVAL; 231 232 + fan = acpi_driver_data(device); 233 234 acpi_fan_remove_fs(device); 235
+2 -2
drivers/acpi/glue.c
··· 96 static acpi_status 97 do_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) 98 { 99 - unsigned long *busnr = (unsigned long *)data; 100 struct acpi_resource_address64 address; 101 102 if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 && ··· 221 acpi_status status; 222 struct acpi_device_info *info; 223 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 224 - struct acpi_find_child *find = (struct acpi_find_child *)context; 225 226 status = acpi_get_object_info(handle, &buffer); 227 if (ACPI_SUCCESS(status)) {
··· 96 static acpi_status 97 do_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) 98 { 99 + unsigned long *busnr = data; 100 struct acpi_resource_address64 address; 101 102 if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 && ··· 221 acpi_status status; 222 struct acpi_device_info *info; 223 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 224 + struct acpi_find_child *find = context; 225 226 status = acpi_get_object_info(handle, &buffer); 227 if (ACPI_SUCCESS(status)) {
+2 -3
drivers/acpi/hotkey.c
··· 265 266 static int hotkey_polling_seq_show(struct seq_file *seq, void *offset) 267 { 268 - struct acpi_polling_hotkey *poll_hotkey = 269 - (struct acpi_polling_hotkey *)seq->private; 270 char *buf; 271 272 ··· 576 if (ACPI_FAILURE(status)) 577 goto do_fail_zero; 578 key->poll_hotkey.poll_result = 579 - (union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL); 580 if (!key->poll_hotkey.poll_result) 581 goto do_fail_zero; 582 return AE_OK;
··· 265 266 static int hotkey_polling_seq_show(struct seq_file *seq, void *offset) 267 { 268 + struct acpi_polling_hotkey *poll_hotkey = seq->private; 269 char *buf; 270 271 ··· 577 if (ACPI_FAILURE(status)) 578 goto do_fail_zero; 579 key->poll_hotkey.poll_result = 580 + kmalloc(sizeof(union acpi_object), GFP_KERNEL); 581 if (!key->poll_hotkey.poll_result) 582 goto do_fail_zero; 583 return AE_OK;
+1 -1
drivers/acpi/i2c_ec.c
··· 393 394 struct acpi_ec_hc *acpi_get_ec_hc(struct acpi_device *device) 395 { 396 - return ((struct acpi_ec_hc *)acpi_driver_data(device->parent)); 397 } 398 399 EXPORT_SYMBOL(acpi_get_ec_hc);
··· 393 394 struct acpi_ec_hc *acpi_get_ec_hc(struct acpi_device *device) 395 { 396 + return acpi_driver_data(device->parent); 397 } 398 399 EXPORT_SYMBOL(acpi_get_ec_hc);
+3 -3
drivers/acpi/ibm_acpi.c
··· 2417 static int dispatch_read(char *page, char **start, off_t off, int count, 2418 int *eof, void *data) 2419 { 2420 - struct ibm_struct *ibm = (struct ibm_struct *)data; 2421 int len; 2422 2423 if (!ibm || !ibm->read) ··· 2442 static int dispatch_write(struct file *file, const char __user * userbuf, 2443 unsigned long count, void *data) 2444 { 2445 - struct ibm_struct *ibm = (struct ibm_struct *)data; 2446 char *kernbuf; 2447 int ret; 2448 ··· 2471 2472 static void dispatch_notify(acpi_handle handle, u32 event, void *data) 2473 { 2474 - struct ibm_struct *ibm = (struct ibm_struct *)data; 2475 2476 if (!ibm || !ibm->notify) 2477 return;
··· 2417 static int dispatch_read(char *page, char **start, off_t off, int count, 2418 int *eof, void *data) 2419 { 2420 + struct ibm_struct *ibm = data; 2421 int len; 2422 2423 if (!ibm || !ibm->read) ··· 2442 static int dispatch_write(struct file *file, const char __user * userbuf, 2443 unsigned long count, void *data) 2444 { 2445 + struct ibm_struct *ibm = data; 2446 char *kernbuf; 2447 int ret; 2448 ··· 2471 2472 static void dispatch_notify(acpi_handle handle, u32 event, void *data) 2473 { 2474 + struct ibm_struct *ibm = data; 2475 2476 if (!ibm || !ibm->notify) 2477 return;
+1 -1
drivers/acpi/numa.c
··· 248 handle = phandle; 249 status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm); 250 if (ACPI_SUCCESS(status)) 251 - return (int)pxm; 252 status = acpi_get_parent(handle, &phandle); 253 } while (ACPI_SUCCESS(status)); 254 return -1;
··· 248 handle = phandle; 249 status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm); 250 if (ACPI_SUCCESS(status)) 251 + return pxm; 252 status = acpi_get_parent(handle, &phandle); 253 } while (ACPI_SUCCESS(status)); 254 return -1;
+2 -1
drivers/acpi/osl.c
··· 568 static void acpi_os_execute_deferred(struct work_struct *work) 569 { 570 struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); 571 if (!dpc) { 572 printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); 573 return; ··· 1052 1053 acpi_status acpi_os_purge_cache(acpi_cache_t * cache) 1054 { 1055 - (void)kmem_cache_shrink(cache); 1056 return (AE_OK); 1057 } 1058
··· 568 static void acpi_os_execute_deferred(struct work_struct *work) 569 { 570 struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); 571 + 572 if (!dpc) { 573 printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); 574 return; ··· 1051 1052 acpi_status acpi_os_purge_cache(acpi_cache_t * cache) 1053 { 1054 + kmem_cache_shrink(cache); 1055 return (AE_OK); 1056 } 1057
+2 -2
drivers/acpi/pci_bind.c
··· 281 if (!device || !device->parent) 282 return -EINVAL; 283 284 - pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 285 if (!pathname) 286 return -ENOMEM; 287 memset(pathname, 0, ACPI_PATHNAME_MAX); ··· 332 struct acpi_buffer buffer = { 0, NULL }; 333 334 335 - pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 336 if (!pathname) 337 return -ENOMEM; 338 memset(pathname, 0, ACPI_PATHNAME_MAX);
··· 281 if (!device || !device->parent) 282 return -EINVAL; 283 284 + pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 285 if (!pathname) 286 return -ENOMEM; 287 memset(pathname, 0, ACPI_PATHNAME_MAX); ··· 332 struct acpi_buffer buffer = { 0, NULL }; 333 334 335 + pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 336 if (!pathname) 337 return -ENOMEM; 338 memset(pathname, 0, ACPI_PATHNAME_MAX);
+1 -1
drivers/acpi/pci_irq.c
··· 161 static int first_time = 1; 162 163 164 - pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 165 if (!pathname) 166 return -ENOMEM; 167 memset(pathname, 0, ACPI_PATHNAME_MAX);
··· 161 static int first_time = 1; 162 163 164 + pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); 165 if (!pathname) 166 return -ENOMEM; 167 memset(pathname, 0, ACPI_PATHNAME_MAX);
+4 -4
drivers/acpi/pci_link.c
··· 103 static acpi_status 104 acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) 105 { 106 - struct acpi_pci_link *link = (struct acpi_pci_link *)context; 107 u32 i = 0; 108 109 ··· 613 return -1; 614 } 615 616 - link = (struct acpi_pci_link *)acpi_driver_data(device); 617 if (!link) { 618 printk(KERN_ERR PREFIX "Invalid link context\n"); 619 return -1; ··· 668 return -1; 669 } 670 671 - link = (struct acpi_pci_link *)acpi_driver_data(device); 672 if (!link) { 673 printk(KERN_ERR PREFIX "Invalid link context\n"); 674 return -1; ··· 808 if (!device || !acpi_driver_data(device)) 809 return -EINVAL; 810 811 - link = (struct acpi_pci_link *)acpi_driver_data(device); 812 813 mutex_lock(&acpi_link_lock); 814 list_del(&link->node);
··· 103 static acpi_status 104 acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) 105 { 106 + struct acpi_pci_link *link = context; 107 u32 i = 0; 108 109 ··· 613 return -1; 614 } 615 616 + link = acpi_driver_data(device); 617 if (!link) { 618 printk(KERN_ERR PREFIX "Invalid link context\n"); 619 return -1; ··· 668 return -1; 669 } 670 671 + link = acpi_driver_data(device); 672 if (!link) { 673 printk(KERN_ERR PREFIX "Invalid link context\n"); 674 return -1; ··· 808 if (!device || !acpi_driver_data(device)) 809 return -EINVAL; 810 811 + link = acpi_driver_data(device); 812 813 mutex_lock(&acpi_link_lock); 814 list_del(&link->node);
+2 -2
drivers/acpi/pci_root.c
··· 119 static acpi_status 120 get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) 121 { 122 - int *busnr = (int *)data; 123 struct acpi_resource_address64 address; 124 125 if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 && ··· 331 if (!device || !acpi_driver_data(device)) 332 return -EINVAL; 333 334 - root = (struct acpi_pci_root *)acpi_driver_data(device); 335 336 kfree(root); 337
··· 119 static acpi_status 120 get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) 121 { 122 + int *busnr = data; 123 struct acpi_resource_address64 address; 124 125 if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 && ··· 331 if (!device || !acpi_driver_data(device)) 332 return -EINVAL; 333 334 + root = acpi_driver_data(device); 335 336 kfree(root); 337
+3 -3
drivers/acpi/power.c
··· 108 return result; 109 } 110 111 - *resource = (struct acpi_power_resource *)acpi_driver_data(device); 112 if (!resource) 113 return -ENODEV; 114 ··· 442 struct acpi_power_resource *resource = NULL; 443 444 445 - resource = (struct acpi_power_resource *)seq->private; 446 447 if (!resource) 448 goto end; ··· 590 if (!device || !acpi_driver_data(device)) 591 return -EINVAL; 592 593 - resource = (struct acpi_power_resource *)acpi_driver_data(device); 594 595 acpi_power_remove_fs(device); 596
··· 108 return result; 109 } 110 111 + *resource = acpi_driver_data(device); 112 if (!resource) 113 return -ENODEV; 114 ··· 442 struct acpi_power_resource *resource = NULL; 443 444 445 + resource = seq->private; 446 447 if (!resource) 448 goto end; ··· 590 if (!device || !acpi_driver_data(device)) 591 return -EINVAL; 592 593 + resource = acpi_driver_data(device); 594 595 acpi_power_remove_fs(device); 596
+5 -5
drivers/acpi/processor_core.c
··· 277 278 static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) 279 { 280 - struct acpi_processor *pr = (struct acpi_processor *)seq->private; 281 282 283 if (!pr) ··· 542 * Don't trust it blindly 543 */ 544 if (processor_device_array[pr->id] != NULL && 545 - processor_device_array[pr->id] != (void *)device) { 546 printk(KERN_WARNING "BIOS reported wrong ACPI id" 547 "for the processor\n"); 548 return -ENODEV; 549 } 550 - processor_device_array[pr->id] = (void *)device; 551 552 processors[pr->id] = pr; 553 ··· 578 579 static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) 580 { 581 - struct acpi_processor *pr = (struct acpi_processor *)data; 582 struct acpi_device *device = NULL; 583 584 ··· 637 if (!device || !acpi_driver_data(device)) 638 return -EINVAL; 639 640 - pr = (struct acpi_processor *)acpi_driver_data(device); 641 642 if (pr->id >= NR_CPUS) { 643 kfree(pr);
··· 277 278 static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) 279 { 280 + struct acpi_processor *pr = seq->private; 281 282 283 if (!pr) ··· 542 * Don't trust it blindly 543 */ 544 if (processor_device_array[pr->id] != NULL && 545 + processor_device_array[pr->id] != device) { 546 printk(KERN_WARNING "BIOS reported wrong ACPI id" 547 "for the processor\n"); 548 return -ENODEV; 549 } 550 + processor_device_array[pr->id] = device; 551 552 processors[pr->id] = pr; 553 ··· 578 579 static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) 580 { 581 + struct acpi_processor *pr = data; 582 struct acpi_device *device = NULL; 583 584 ··· 637 if (!device || !acpi_driver_data(device)) 638 return -EINVAL; 639 640 + pr = acpi_driver_data(device); 641 642 if (pr->id >= NR_CPUS) { 643 kfree(pr);
+7 -7
drivers/acpi/processor_idle.c
··· 673 return -ENODEV; 674 } 675 676 - cst = (union acpi_object *)buffer.pointer; 677 678 /* There must be at least 2 elements */ 679 if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) { ··· 702 703 memset(&cx, 0, sizeof(cx)); 704 705 - element = (union acpi_object *)&(cst->package.elements[i]); 706 if (element->type != ACPI_TYPE_PACKAGE) 707 continue; 708 709 if (element->package.count != 4) 710 continue; 711 712 - obj = (union acpi_object *)&(element->package.elements[0]); 713 714 if (obj->type != ACPI_TYPE_BUFFER) 715 continue; ··· 721 continue; 722 723 /* There should be an easy way to extract an integer... */ 724 - obj = (union acpi_object *)&(element->package.elements[1]); 725 if (obj->type != ACPI_TYPE_INTEGER) 726 continue; 727 ··· 754 } 755 } 756 757 - obj = (union acpi_object *)&(element->package.elements[2]); 758 if (obj->type != ACPI_TYPE_INTEGER) 759 continue; 760 761 cx.latency = obj->integer.value; 762 763 - obj = (union acpi_object *)&(element->package.elements[3]); 764 if (obj->type != ACPI_TYPE_INTEGER) 765 continue; 766 ··· 1029 1030 static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) 1031 { 1032 - struct acpi_processor *pr = (struct acpi_processor *)seq->private; 1033 unsigned int i; 1034 1035
··· 673 return -ENODEV; 674 } 675 676 + cst = buffer.pointer; 677 678 /* There must be at least 2 elements */ 679 if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) { ··· 702 703 memset(&cx, 0, sizeof(cx)); 704 705 + element = &(cst->package.elements[i]); 706 if (element->type != ACPI_TYPE_PACKAGE) 707 continue; 708 709 if (element->package.count != 4) 710 continue; 711 712 + obj = &(element->package.elements[0]); 713 714 if (obj->type != ACPI_TYPE_BUFFER) 715 continue; ··· 721 continue; 722 723 /* There should be an easy way to extract an integer... */ 724 + obj = &(element->package.elements[1]); 725 if (obj->type != ACPI_TYPE_INTEGER) 726 continue; 727 ··· 754 } 755 } 756 757 + obj = &(element->package.elements[2]); 758 if (obj->type != ACPI_TYPE_INTEGER) 759 continue; 760 761 cx.latency = obj->integer.value; 762 763 + obj = &(element->package.elements[3]); 764 if (obj->type != ACPI_TYPE_INTEGER) 765 continue; 766 ··· 1029 1030 static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) 1031 { 1032 + struct acpi_processor *pr = seq->private; 1033 unsigned int i; 1034 1035
+5 -5
drivers/acpi/processor_perflib.c
··· 236 return -ENODEV; 237 } 238 239 - pss = (union acpi_object *)buffer.pointer; 240 if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) { 241 printk(KERN_ERR PREFIX "Invalid _PSS data\n"); 242 result = -EFAULT; ··· 410 411 static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset) 412 { 413 - struct acpi_processor *pr = (struct acpi_processor *)seq->private; 414 int i; 415 416 ··· 451 size_t count, loff_t * data) 452 { 453 int result = 0; 454 - struct seq_file *m = (struct seq_file *)file->private_data; 455 - struct acpi_processor *pr = (struct acpi_processor *)m->private; 456 struct acpi_processor_performance *perf; 457 char state_string[12] = { '\0' }; 458 unsigned int new_state = 0; ··· 551 return -ENODEV; 552 } 553 554 - psd = (union acpi_object *) buffer.pointer; 555 if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) { 556 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n")); 557 result = -EFAULT;
··· 236 return -ENODEV; 237 } 238 239 + pss = buffer.pointer; 240 if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) { 241 printk(KERN_ERR PREFIX "Invalid _PSS data\n"); 242 result = -EFAULT; ··· 410 411 static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset) 412 { 413 + struct acpi_processor *pr = seq->private; 414 int i; 415 416 ··· 451 size_t count, loff_t * data) 452 { 453 int result = 0; 454 + struct seq_file *m = file->private_data; 455 + struct acpi_processor *pr = m->private; 456 struct acpi_processor_performance *perf; 457 char state_string[12] = { '\0' }; 458 unsigned int new_state = 0; ··· 551 return -ENODEV; 552 } 553 554 + psd = buffer.pointer; 555 if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) { 556 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n")); 557 result = -EFAULT;
+3 -3
drivers/acpi/processor_thermal.c
··· 208 if (result) 209 return result; 210 211 - pr = (struct acpi_processor *)acpi_driver_data(device); 212 if (!pr) 213 return -ENODEV; 214 ··· 348 size_t count, loff_t * data) 349 { 350 int result = 0; 351 - struct seq_file *m = (struct seq_file *)file->private_data; 352 - struct acpi_processor *pr = (struct acpi_processor *)m->private; 353 char limit_string[25] = { '\0' }; 354 int px = 0; 355 int tx = 0;
··· 208 if (result) 209 return result; 210 211 + pr = acpi_driver_data(device); 212 if (!pr) 213 return -ENODEV; 214 ··· 348 size_t count, loff_t * data) 349 { 350 int result = 0; 351 + struct seq_file *m = file->private_data; 352 + struct acpi_processor *pr = m->private; 353 char limit_string[25] = { '\0' }; 354 int px = 0; 355 int tx = 0;
+3 -3
drivers/acpi/processor_throttling.c
··· 259 static int acpi_processor_throttling_seq_show(struct seq_file *seq, 260 void *offset) 261 { 262 - struct acpi_processor *pr = (struct acpi_processor *)seq->private; 263 int i = 0; 264 int result = 0; 265 ··· 307 size_t count, loff_t * data) 308 { 309 int result = 0; 310 - struct seq_file *m = (struct seq_file *)file->private_data; 311 - struct acpi_processor *pr = (struct acpi_processor *)m->private; 312 char state_string[12] = { '\0' }; 313 314
··· 259 static int acpi_processor_throttling_seq_show(struct seq_file *seq, 260 void *offset) 261 { 262 + struct acpi_processor *pr = seq->private; 263 int i = 0; 264 int result = 0; 265 ··· 307 size_t count, loff_t * data) 308 { 309 int result = 0; 310 + struct seq_file *m = file->private_data; 311 + struct acpi_processor *pr = m->private; 312 char state_string[12] = { '\0' }; 313 314
+12 -12
drivers/acpi/sbs.c
··· 923 924 static int acpi_battery_read_info(struct seq_file *seq, void *offset) 925 { 926 - struct acpi_battery *battery = (struct acpi_battery *)seq->private; 927 int cscale; 928 int result = 0; 929 ··· 1076 1077 static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) 1078 { 1079 - struct acpi_battery *battery = (struct acpi_battery *)seq->private; 1080 int result = 0; 1081 int cscale; 1082 ··· 1125 acpi_battery_write_alarm(struct file *file, const char __user * buffer, 1126 size_t count, loff_t * ppos) 1127 { 1128 - struct seq_file *seq = (struct seq_file *)file->private_data; 1129 - struct acpi_battery *battery = (struct acpi_battery *)seq->private; 1130 char alarm_string[12] = { '\0' }; 1131 int result, old_alarm, new_alarm; 1132 ··· 1160 if (result) { 1161 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1162 "acpi_battery_set_alarm() failed\n")); 1163 - (void)acpi_battery_set_alarm(battery, old_alarm); 1164 goto end; 1165 } 1166 result = acpi_battery_get_alarm(battery); 1167 if (result) { 1168 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1169 "acpi_battery_get_alarm() failed\n")); 1170 - (void)acpi_battery_set_alarm(battery, old_alarm); 1171 goto end; 1172 } 1173 ··· 1217 1218 static int acpi_ac_read_state(struct seq_file *seq, void *offset) 1219 { 1220 - struct acpi_sbs *sbs = (struct acpi_sbs *)seq->private; 1221 int result; 1222 1223 if (sbs->zombie) { ··· 1302 battery->init_state = 1; 1303 } 1304 1305 - (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); 1306 1307 result = acpi_sbs_generic_add_fs(&battery->battery_entry, 1308 acpi_battery_dir, ··· 1485 } 1486 1487 if (old_battery_present != new_battery_present) { 1488 - (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); 1489 result = acpi_sbs_generate_event(sbs->device, 1490 ACPI_SBS_BATTERY_NOTIFY_STATUS, 1491 new_battery_present, ··· 1498 } 1499 } 1500 if (old_remaining_capacity != battery->state.remaining_capacity) { 1501 - (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); 1502 result = acpi_sbs_generate_event(sbs->device, 1503 ACPI_SBS_BATTERY_NOTIFY_STATUS, 1504 new_battery_present, ··· 1659 init_timer(&sbs->update_timer); 1660 if (update_mode == QUEUE_UPDATE_MODE) { 1661 status = acpi_os_execute(OSL_GPE_HANDLER, 1662 - acpi_sbs_update_queue, (void *)sbs); 1663 if (status != AE_OK) { 1664 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1665 "acpi_os_execute() failed\n")); ··· 1685 1686 int acpi_sbs_remove(struct acpi_device *device, int type) 1687 { 1688 - struct acpi_sbs *sbs = NULL; 1689 int id; 1690 1691 if (!device) {
··· 923 924 static int acpi_battery_read_info(struct seq_file *seq, void *offset) 925 { 926 + struct acpi_battery *battery = seq->private; 927 int cscale; 928 int result = 0; 929 ··· 1076 1077 static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) 1078 { 1079 + struct acpi_battery *battery = seq->private; 1080 int result = 0; 1081 int cscale; 1082 ··· 1125 acpi_battery_write_alarm(struct file *file, const char __user * buffer, 1126 size_t count, loff_t * ppos) 1127 { 1128 + struct seq_file *seq = file->private_data; 1129 + struct acpi_battery *battery = seq->private; 1130 char alarm_string[12] = { '\0' }; 1131 int result, old_alarm, new_alarm; 1132 ··· 1160 if (result) { 1161 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1162 "acpi_battery_set_alarm() failed\n")); 1163 + acpi_battery_set_alarm(battery, old_alarm); 1164 goto end; 1165 } 1166 result = acpi_battery_get_alarm(battery); 1167 if (result) { 1168 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1169 "acpi_battery_get_alarm() failed\n")); 1170 + acpi_battery_set_alarm(battery, old_alarm); 1171 goto end; 1172 } 1173 ··· 1217 1218 static int acpi_ac_read_state(struct seq_file *seq, void *offset) 1219 { 1220 + struct acpi_sbs *sbs = seq->private; 1221 int result; 1222 1223 if (sbs->zombie) { ··· 1302 battery->init_state = 1; 1303 } 1304 1305 + sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); 1306 1307 result = acpi_sbs_generic_add_fs(&battery->battery_entry, 1308 acpi_battery_dir, ··· 1485 } 1486 1487 if (old_battery_present != new_battery_present) { 1488 + sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); 1489 result = acpi_sbs_generate_event(sbs->device, 1490 ACPI_SBS_BATTERY_NOTIFY_STATUS, 1491 new_battery_present, ··· 1498 } 1499 } 1500 if (old_remaining_capacity != battery->state.remaining_capacity) { 1501 + sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); 1502 result = acpi_sbs_generate_event(sbs->device, 1503 ACPI_SBS_BATTERY_NOTIFY_STATUS, 1504 new_battery_present, ··· 1659 init_timer(&sbs->update_timer); 1660 if (update_mode == QUEUE_UPDATE_MODE) { 1661 status = acpi_os_execute(OSL_GPE_HANDLER, 1662 + acpi_sbs_update_queue, sbs); 1663 if (status != AE_OK) { 1664 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1665 "acpi_os_execute() failed\n")); ··· 1685 1686 int acpi_sbs_remove(struct acpi_device *device, int type) 1687 { 1688 + struct acpi_sbs *sbs; 1689 int id; 1690 1691 if (!device) {
+1 -1
drivers/acpi/tables.c
··· 228 static int 229 acpi_table_compute_checksum(void *table_pointer, unsigned long length) 230 { 231 - u8 *p = (u8 *) table_pointer; 232 unsigned long remains = length; 233 unsigned long sum = 0; 234
··· 228 static int 229 acpi_table_compute_checksum(void *table_pointer, unsigned long length) 230 { 231 + u8 *p = table_pointer; 232 unsigned long remains = length; 233 unsigned long sum = 0; 234
+15 -15
drivers/acpi/thermal.c
··· 663 static void acpi_thermal_check(void *data) 664 { 665 int result = 0; 666 - struct acpi_thermal *tz = (struct acpi_thermal *)data; 667 unsigned long sleep_time = 0; 668 int i = 0; 669 struct acpi_thermal_state state; ··· 778 779 static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset) 780 { 781 - struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 782 783 784 if (!tz) ··· 813 static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset) 814 { 815 int result = 0; 816 - struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 817 818 819 if (!tz) ··· 837 838 static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) 839 { 840 - struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 841 int i = 0; 842 int j = 0; 843 ··· 893 const char __user * buffer, 894 size_t count, loff_t * ppos) 895 { 896 - struct seq_file *m = (struct seq_file *)file->private_data; 897 - struct acpi_thermal *tz = (struct acpi_thermal *)m->private; 898 899 char *limit_string; 900 int num, critical, hot, passive; ··· 953 954 static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset) 955 { 956 - struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 957 958 959 if (!tz) ··· 984 const char __user * buffer, 985 size_t count, loff_t * ppos) 986 { 987 - struct seq_file *m = (struct seq_file *)file->private_data; 988 - struct acpi_thermal *tz = (struct acpi_thermal *)m->private; 989 int result = 0; 990 char mode_string[12] = { '\0' }; 991 ··· 1014 1015 static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset) 1016 { 1017 - struct acpi_thermal *tz = (struct acpi_thermal *)seq->private; 1018 1019 1020 if (!tz) ··· 1043 const char __user * buffer, 1044 size_t count, loff_t * ppos) 1045 { 1046 - struct seq_file *m = (struct seq_file *)file->private_data; 1047 - struct acpi_thermal *tz = (struct acpi_thermal *)m->private; 1048 int result = 0; 1049 char polling_string[12] = { '\0' }; 1050 int seconds = 0; ··· 1170 1171 static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data) 1172 { 1173 - struct acpi_thermal *tz = (struct acpi_thermal *)data; 1174 struct acpi_device *device = NULL; 1175 1176 ··· 1324 if (!device || !acpi_driver_data(device)) 1325 return -EINVAL; 1326 1327 - tz = (struct acpi_thermal *)acpi_driver_data(device); 1328 1329 /* avoid timer adding new defer task */ 1330 tz->zombie = 1; ··· 1364 if (!device || !acpi_driver_data(device)) 1365 return -EINVAL; 1366 1367 - tz = (struct acpi_thermal *)acpi_driver_data(device); 1368 1369 acpi_thermal_get_temperature(tz); 1370
··· 663 static void acpi_thermal_check(void *data) 664 { 665 int result = 0; 666 + struct acpi_thermal *tz = data; 667 unsigned long sleep_time = 0; 668 int i = 0; 669 struct acpi_thermal_state state; ··· 778 779 static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset) 780 { 781 + struct acpi_thermal *tz = seq->private; 782 783 784 if (!tz) ··· 813 static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset) 814 { 815 int result = 0; 816 + struct acpi_thermal *tz = seq->private; 817 818 819 if (!tz) ··· 837 838 static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) 839 { 840 + struct acpi_thermal *tz = seq->private; 841 int i = 0; 842 int j = 0; 843 ··· 893 const char __user * buffer, 894 size_t count, loff_t * ppos) 895 { 896 + struct seq_file *m = file->private_data; 897 + struct acpi_thermal *tz = m->private; 898 899 char *limit_string; 900 int num, critical, hot, passive; ··· 953 954 static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset) 955 { 956 + struct acpi_thermal *tz = seq->private; 957 958 959 if (!tz) ··· 984 const char __user * buffer, 985 size_t count, loff_t * ppos) 986 { 987 + struct seq_file *m = file->private_data; 988 + struct acpi_thermal *tz = m->private; 989 int result = 0; 990 char mode_string[12] = { '\0' }; 991 ··· 1014 1015 static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset) 1016 { 1017 + struct acpi_thermal *tz = seq->private; 1018 1019 1020 if (!tz) ··· 1043 const char __user * buffer, 1044 size_t count, loff_t * ppos) 1045 { 1046 + struct seq_file *m = file->private_data; 1047 + struct acpi_thermal *tz = m->private; 1048 int result = 0; 1049 char polling_string[12] = { '\0' }; 1050 int seconds = 0; ··· 1170 1171 static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data) 1172 { 1173 + struct acpi_thermal *tz = data; 1174 struct acpi_device *device = NULL; 1175 1176 ··· 1324 if (!device || !acpi_driver_data(device)) 1325 return -EINVAL; 1326 1327 + tz = acpi_driver_data(device); 1328 1329 /* avoid timer adding new defer task */ 1330 tz->zombie = 1; ··· 1364 if (!device || !acpi_driver_data(device)) 1365 return -EINVAL; 1366 1367 + tz = acpi_driver_data(device); 1368 1369 acpi_thermal_get_temperature(tz); 1370
+2 -2
drivers/acpi/utils.c
··· 83 return AE_BAD_DATA; 84 } 85 86 - format_string = (char *)format->pointer; 87 88 /* 89 * Calculate size_required. ··· 361 if (ACPI_FAILURE(status)) 362 goto end; 363 364 - package = (union acpi_object *)buffer.pointer; 365 366 if ((buffer.length == 0) || !package) { 367 printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n",
··· 83 return AE_BAD_DATA; 84 } 85 86 + format_string = format->pointer; 87 88 /* 89 * Calculate size_required. ··· 361 if (ACPI_FAILURE(status)) 362 goto end; 363 364 + package = buffer.pointer; 365 366 if ((buffer.length == 0) || !package) { 367 printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n",
+27 -32
drivers/acpi/video.c
··· 386 if (ACPI_FAILURE(status)) 387 return -ENODEV; 388 389 - obj = (union acpi_object *)buffer.pointer; 390 391 if (obj && obj->type == ACPI_TYPE_BUFFER) 392 *edid = obj; ··· 654 655 static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset) 656 { 657 - struct acpi_video_device *dev = 658 - (struct acpi_video_device *)seq->private; 659 660 661 if (!dev) ··· 687 static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) 688 { 689 int status; 690 - struct acpi_video_device *dev = 691 - (struct acpi_video_device *)seq->private; 692 unsigned long state; 693 694 ··· 725 size_t count, loff_t * data) 726 { 727 int status; 728 - struct seq_file *m = (struct seq_file *)file->private_data; 729 - struct acpi_video_device *dev = (struct acpi_video_device *)m->private; 730 char str[12] = { 0 }; 731 u32 state = 0; 732 ··· 752 static int 753 acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset) 754 { 755 - struct acpi_video_device *dev = 756 - (struct acpi_video_device *)seq->private; 757 int i; 758 759 ··· 781 const char __user * buffer, 782 size_t count, loff_t * data) 783 { 784 - struct seq_file *m = (struct seq_file *)file->private_data; 785 - struct acpi_video_device *dev = (struct acpi_video_device *)m->private; 786 char str[4] = { 0 }; 787 unsigned int level = 0; 788 int i; ··· 814 815 static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) 816 { 817 - struct acpi_video_device *dev = 818 - (struct acpi_video_device *)seq->private; 819 int status; 820 int i; 821 union acpi_object *edid = NULL; ··· 862 if (!device) 863 return -ENODEV; 864 865 - vid_dev = (struct acpi_video_device *)acpi_driver_data(device); 866 if (!vid_dev) 867 return -ENODEV; 868 ··· 927 { 928 struct acpi_video_device *vid_dev; 929 930 - vid_dev = (struct acpi_video_device *)acpi_driver_data(device); 931 if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) 932 return -ENODEV; 933 ··· 946 /* video bus */ 947 static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset) 948 { 949 - struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; 950 951 952 if (!video) ··· 971 972 static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset) 973 { 974 - struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; 975 976 977 if (!video) ··· 991 992 static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) 993 { 994 - struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; 995 unsigned long options; 996 int status; 997 ··· 1029 1030 static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) 1031 { 1032 - struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; 1033 int status; 1034 unsigned long id; 1035 ··· 1050 1051 static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset) 1052 { 1053 - struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; 1054 1055 1056 seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); ··· 1075 size_t count, loff_t * data) 1076 { 1077 int status; 1078 - struct seq_file *m = (struct seq_file *)file->private_data; 1079 - struct acpi_video_bus *video = (struct acpi_video_bus *)m->private; 1080 char str[12] = { 0 }; 1081 unsigned long opt, options; 1082 ··· 1115 size_t count, loff_t * data) 1116 { 1117 int status; 1118 - struct seq_file *m = (struct seq_file *)file->private_data; 1119 - struct acpi_video_bus *video = (struct acpi_video_bus *)m->private; 1120 char str[12] = { 0 }; 1121 unsigned long opt; 1122 ··· 1146 struct acpi_video_bus *video; 1147 1148 1149 - video = (struct acpi_video_bus *)acpi_driver_data(device); 1150 1151 if (!acpi_device_dir(device)) { 1152 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), ··· 1222 struct acpi_video_bus *video; 1223 1224 1225 - video = (struct acpi_video_bus *)acpi_driver_data(device); 1226 1227 if (acpi_device_dir(device)) { 1228 remove_proc_entry("info", acpi_device_dir(device)); ··· 1399 return status; 1400 } 1401 1402 - dod = (union acpi_object *)buffer.pointer; 1403 if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) { 1404 ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data")); 1405 status = -EFAULT; ··· 1422 1423 count = 0; 1424 for (i = 0; i < dod->package.count; i++) { 1425 - obj = (union acpi_object *)&dod->package.elements[i]; 1426 1427 if (obj->type != ACPI_TYPE_INTEGER) { 1428 printk(KERN_ERR PREFIX "Invalid _DOD data\n"); ··· 1608 1609 static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) 1610 { 1611 - struct acpi_video_bus *video = (struct acpi_video_bus *)data; 1612 struct acpi_device *device = NULL; 1613 1614 printk("video bus notify\n"); ··· 1650 1651 static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) 1652 { 1653 - struct acpi_video_device *video_device = 1654 - (struct acpi_video_device *)data; 1655 struct acpi_device *device = NULL; 1656 1657 ··· 1752 if (!device || !acpi_driver_data(device)) 1753 return -EINVAL; 1754 1755 - video = (struct acpi_video_bus *)acpi_driver_data(device); 1756 1757 acpi_video_bus_stop_devices(video); 1758
··· 386 if (ACPI_FAILURE(status)) 387 return -ENODEV; 388 389 + obj = buffer.pointer; 390 391 if (obj && obj->type == ACPI_TYPE_BUFFER) 392 *edid = obj; ··· 654 655 static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset) 656 { 657 + struct acpi_video_device *dev = seq->private; 658 659 660 if (!dev) ··· 688 static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) 689 { 690 int status; 691 + struct acpi_video_device *dev = seq->private; 692 unsigned long state; 693 694 ··· 727 size_t count, loff_t * data) 728 { 729 int status; 730 + struct seq_file *m = file->private_data; 731 + struct acpi_video_device *dev = m->private; 732 char str[12] = { 0 }; 733 u32 state = 0; 734 ··· 754 static int 755 acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset) 756 { 757 + struct acpi_video_device *dev = seq->private; 758 int i; 759 760 ··· 784 const char __user * buffer, 785 size_t count, loff_t * data) 786 { 787 + struct seq_file *m = file->private_data; 788 + struct acpi_video_device *dev = m->private; 789 char str[4] = { 0 }; 790 unsigned int level = 0; 791 int i; ··· 817 818 static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) 819 { 820 + struct acpi_video_device *dev = seq->private; 821 int status; 822 int i; 823 union acpi_object *edid = NULL; ··· 866 if (!device) 867 return -ENODEV; 868 869 + vid_dev = acpi_driver_data(device); 870 if (!vid_dev) 871 return -ENODEV; 872 ··· 931 { 932 struct acpi_video_device *vid_dev; 933 934 + vid_dev = acpi_driver_data(device); 935 if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) 936 return -ENODEV; 937 ··· 950 /* video bus */ 951 static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset) 952 { 953 + struct acpi_video_bus *video = seq->private; 954 955 956 if (!video) ··· 975 976 static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset) 977 { 978 + struct acpi_video_bus *video = seq->private; 979 980 981 if (!video) ··· 995 996 static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) 997 { 998 + struct acpi_video_bus *video = seq->private; 999 unsigned long options; 1000 int status; 1001 ··· 1033 1034 static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) 1035 { 1036 + struct acpi_video_bus *video = seq->private; 1037 int status; 1038 unsigned long id; 1039 ··· 1054 1055 static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset) 1056 { 1057 + struct acpi_video_bus *video = seq->private; 1058 1059 1060 seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); ··· 1079 size_t count, loff_t * data) 1080 { 1081 int status; 1082 + struct seq_file *m = file->private_data; 1083 + struct acpi_video_bus *video = m->private; 1084 char str[12] = { 0 }; 1085 unsigned long opt, options; 1086 ··· 1119 size_t count, loff_t * data) 1120 { 1121 int status; 1122 + struct seq_file *m = file->private_data; 1123 + struct acpi_video_bus *video = m->private; 1124 char str[12] = { 0 }; 1125 unsigned long opt; 1126 ··· 1150 struct acpi_video_bus *video; 1151 1152 1153 + video = acpi_driver_data(device); 1154 1155 if (!acpi_device_dir(device)) { 1156 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), ··· 1226 struct acpi_video_bus *video; 1227 1228 1229 + video = acpi_driver_data(device); 1230 1231 if (acpi_device_dir(device)) { 1232 remove_proc_entry("info", acpi_device_dir(device)); ··· 1403 return status; 1404 } 1405 1406 + dod = buffer.pointer; 1407 if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) { 1408 ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data")); 1409 status = -EFAULT; ··· 1426 1427 count = 0; 1428 for (i = 0; i < dod->package.count; i++) { 1429 + obj = &dod->package.elements[i]; 1430 1431 if (obj->type != ACPI_TYPE_INTEGER) { 1432 printk(KERN_ERR PREFIX "Invalid _DOD data\n"); ··· 1612 1613 static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) 1614 { 1615 + struct acpi_video_bus *video = data; 1616 struct acpi_device *device = NULL; 1617 1618 printk("video bus notify\n"); ··· 1654 1655 static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) 1656 { 1657 + struct acpi_video_device *video_device = data; 1658 struct acpi_device *device = NULL; 1659 1660 ··· 1757 if (!device || !acpi_driver_data(device)) 1758 return -EINVAL; 1759 1760 + video = acpi_driver_data(device); 1761 1762 acpi_video_bus_stop_devices(video); 1763