Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (30 commits)
ACPI: work around duplicate name "VID" problem on T61
acpiphp_ibm: add missing '\n' to error message
ACPI: add dump_stack() to trace acpi_format_exception programming errors
make drivers/acpi/scan.c:create_modalias() static
ACPI: Fix a warning of discarding qualifiers from pointer target type
ACPI: "ACPI handle has no context!" should be KERN_DEBUG
ACPI video hotkey: export missing ACPI video hotkey events via input layer
ACPI: Validate XSDT, use RSDT if XSDT fails
ACPI: /proc/acpi/thermal_zone trip points are now read-only, mark them as such
ACPI: fix ia64 allnoconfig build
PNP: remove null pointer checks
PNP: remove MODULE infrastructure
ISAPNP: removed unused isapnp_detected and ISAPNP_DEBUG
PNPACPI: remove unnecessary casts of "void *"
PNPACPI: simplify irq_flags()
PNP: fix up after Lindent
ACPI: enable GPEs before calling _WAK on resume
asus-laptop: Fix rmmod of asus_laptop
sony-laptop: call sonypi_compat_init earlier
sony-laptop: enable Vaio FZ events
...

+502 -336
+8
Documentation/feature-removal-schedule.txt
··· 197 197 198 198 --------------------------- 199 199 200 + What: /proc/acpi/event 201 + When: February 2008 202 + Why: /proc/acpi/event has been replaced by events via the input layer 203 + and netlink since 2.6.23. 204 + Who: Len Brown <len.brown@intel.com> 205 + 206 + --------------------------- 207 + 200 208 What: Compaq touchscreen device emulation 201 209 When: Oct 2007 202 210 Files: drivers/input/tsdev.c
+10 -9
Documentation/kernel-parameters.txt
··· 952 952 Format: <1-256> 953 953 954 954 maxcpus= [SMP] Maximum number of processors that an SMP kernel 955 - should make use of. 956 - Using "nosmp" or "maxcpus=0" will disable SMP 957 - entirely (the MPS table probe still happens, though). 958 - A command-line option of "maxcpus=<NUM>", where <NUM> 959 - is an integer greater than 0, limits the maximum number 960 - of CPUs activated in SMP mode to <NUM>. 961 - Using "maxcpus=1" on an SMP kernel is the trivial 962 - case of an SMP kernel with only one CPU. 955 + should make use of. maxcpus=n : n >= 0 limits the 956 + kernel to using 'n' processors. n=0 is a special case, 957 + it is equivalent to "nosmp", which also disables 958 + the IO APIC. 963 959 964 960 max_addr=[KMG] [KNL,BOOT,ia64] All physical memory greater than or 965 961 equal to this physical address is ignored. ··· 1180 1184 1181 1185 nosep [BUGS=X86-32] Disables x86 SYSENTER/SYSEXIT support. 1182 1186 1183 - nosmp [SMP] Tells an SMP kernel to act as a UP kernel. 1187 + nosmp [SMP] Tells an SMP kernel to act as a UP kernel, 1188 + and disable the IO APIC. legacy for "maxcpus=0". 1184 1189 1185 1190 nosoftlockup [KNL] Disable the soft-lockup detector. 1186 1191 ··· 1822 1825 thermal.act= [HW,ACPI] 1823 1826 -1: disable all active trip points in all thermal zones 1824 1827 <degrees C>: override all lowest active trip points 1828 + 1829 + thermal.crt= [HW,ACPI] 1830 + -1: disable all critical trip points in all thermal zones 1831 + <degrees C>: lower all critical trip points 1825 1832 1826 1833 thermal.nocrt= [HW,ACPI] 1827 1834 Set to disable actions on ACPI thermal zone
-8
arch/i386/kernel/io_apic.c
··· 754 754 static int pirqs_enabled; 755 755 int skip_ioapic_setup; 756 756 757 - static int __init ioapic_setup(char *str) 758 - { 759 - skip_ioapic_setup = 1; 760 - return 1; 761 - } 762 - 763 - __setup("noapic", ioapic_setup); 764 - 765 757 static int __init ioapic_pirq_setup(char *str) 766 758 { 767 759 int i, max;
+3 -5
arch/x86_64/kernel/io_apic.c
··· 397 397 int skip_ioapic_setup; 398 398 int ioapic_force; 399 399 400 - /* dummy parsing: see setup.c */ 401 - 402 - static int __init disable_ioapic_setup(char *str) 400 + static int __init parse_noapic(char *str) 403 401 { 404 - skip_ioapic_setup = 1; 402 + disable_ioapic_setup(); 405 403 return 0; 406 404 } 407 - early_param("noapic", disable_ioapic_setup); 405 + early_param("noapic", parse_noapic); 408 406 409 407 /* Actually the next is obsolete, but keep it for paranoid reasons -AK */ 410 408 static int __init disable_timer_pin_setup(char *arg)
+14
drivers/acpi/Kconfig
··· 68 68 69 69 Say N to delete /proc/acpi/ files that have moved to /sys/ 70 70 71 + config ACPI_PROC_EVENT 72 + bool "Deprecated /proc/acpi/event support" 73 + depends on PROC_FS 74 + ---help--- 75 + A user-space daemon, acpi, typically read /proc/acpi/event 76 + and handled all ACPI sub-system generated events. 77 + 78 + These events are now delivered to user-space via 79 + either the input layer, or as netlink events. 80 + 81 + This build option enables the old code for for legacy 82 + user-space implementation. After some time, this will 83 + be moved under CONFIG_ACPI_PROCFS, and then deleted. 84 + 71 85 config ACPI_AC 72 86 tristate "AC Adapter" 73 87 depends on X86
+4 -1
drivers/acpi/ac.c
··· 204 204 case ACPI_NOTIFY_BUS_CHECK: 205 205 case ACPI_NOTIFY_DEVICE_CHECK: 206 206 acpi_ac_get_state(ac); 207 - acpi_bus_generate_event(device, event, (u32) ac->state); 207 + acpi_bus_generate_proc_event(device, event, (u32) ac->state); 208 + acpi_bus_generate_netlink_event(device->pnp.device_class, 209 + device->dev.bus_id, event, 210 + (u32) ac->state); 208 211 break; 209 212 default: 210 213 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+1 -1
drivers/acpi/asus_acpi.c
··· 1069 1069 hotk->brightness = (event & ~((u32) BR_DOWN)); 1070 1070 } 1071 1071 1072 - acpi_bus_generate_event(hotk->device, event, 1072 + acpi_bus_generate_proc_event(hotk->device, event, 1073 1073 hotk->event_count[event % 128]++); 1074 1074 1075 1075 return;
+34 -18
drivers/acpi/battery.c
··· 113 113 acpi_string oem_info; 114 114 }; 115 115 116 - enum acpi_battery_files { 116 + enum acpi_battery_files{ 117 117 ACPI_BATTERY_INFO = 0, 118 118 ACPI_BATTERY_STATE, 119 119 ACPI_BATTERY_ALARM, ··· 129 129 }; 130 130 131 131 struct acpi_battery { 132 + struct mutex mutex; 132 133 struct acpi_device *device; 133 134 struct acpi_battery_flags flags; 134 135 struct acpi_buffer bif_data; 135 136 struct acpi_buffer bst_data; 136 - struct mutex lock; 137 137 unsigned long alarm; 138 138 unsigned long update_time[ACPI_BATTERY_NUMFILES]; 139 - 140 139 }; 141 140 142 141 inline int acpi_battery_present(struct acpi_battery *battery) ··· 235 236 return 0; 236 237 237 238 /* Evaluate _BIF */ 238 - mutex_lock(&battery->lock); 239 - status = acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", 240 - NULL, &buffer); 241 - mutex_unlock(&battery->lock); 239 + 240 + status = 241 + acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", NULL, 242 + &buffer); 242 243 if (ACPI_FAILURE(status)) { 243 244 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); 244 245 return -ENODEV; ··· 285 286 return 0; 286 287 287 288 /* Evaluate _BST */ 288 - mutex_lock(&battery->lock); 289 - status = acpi_evaluate_object(acpi_battery_handle(battery), "_BST", 290 - NULL, &buffer); 291 - mutex_unlock(&battery->lock); 289 + 290 + status = 291 + acpi_evaluate_object(acpi_battery_handle(battery), "_BST", NULL, 292 + &buffer); 292 293 if (ACPI_FAILURE(status)) { 293 294 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); 294 295 return -ENODEV; ··· 336 337 337 338 arg0.integer.value = alarm; 338 339 339 - mutex_lock(&battery->lock); 340 - status = acpi_evaluate_object(acpi_battery_handle(battery), "_BTP", 340 + status = 341 + acpi_evaluate_object(acpi_battery_handle(battery), "_BTP", 341 342 &arg_list, NULL); 342 - mutex_unlock(&battery->lock); 343 343 if (ACPI_FAILURE(status)) 344 344 return -ENODEV; 345 345 ··· 658 660 if (!battery || (count > sizeof(alarm_string) - 1)) 659 661 return -EINVAL; 660 662 663 + mutex_lock(&battery->mutex); 664 + 661 665 result = acpi_battery_update(battery, 1, &update_result); 662 666 if (result) { 663 667 result = -ENODEV; ··· 688 688 acpi_battery_check_result(battery, result); 689 689 690 690 if (!result) 691 - return count; 691 + result = count; 692 + 693 + mutex_unlock(&battery->mutex); 692 694 693 695 return result; 694 696 } ··· 714 712 int update_result = ACPI_BATTERY_NONE_UPDATE; 715 713 int update = 0; 716 714 715 + mutex_lock(&battery->mutex); 716 + 717 717 update = (get_seconds() - battery->update_time[fid] >= update_time); 718 718 update = (update | battery->flags.update[fid]); 719 719 ··· 733 729 result = acpi_read_funcs[fid].print(seq, result); 734 730 acpi_battery_check_result(battery, result); 735 731 battery->flags.update[fid] = result; 732 + mutex_unlock(&battery->mutex); 736 733 return result; 737 734 } 738 735 ··· 872 867 case ACPI_NOTIFY_DEVICE_CHECK: 873 868 device = battery->device; 874 869 acpi_battery_notify_update(battery); 875 - acpi_bus_generate_event(device, event, 870 + acpi_bus_generate_proc_event(device, event, 876 871 acpi_battery_present(battery)); 872 + acpi_bus_generate_netlink_event(device->pnp.device_class, 873 + device->dev.bus_id, event, 874 + acpi_battery_present(battery)); 877 875 break; 878 876 default: 879 877 ACPI_DEBUG_PRINT((ACPI_DB_INFO, ··· 900 892 if (!battery) 901 893 return -ENOMEM; 902 894 903 - mutex_init(&battery->lock); 895 + mutex_init(&battery->mutex); 896 + 897 + mutex_lock(&battery->mutex); 898 + 904 899 battery->device = device; 905 900 strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); 906 901 strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); ··· 939 928 kfree(battery); 940 929 } 941 930 931 + mutex_unlock(&battery->mutex); 942 932 943 933 return result; 944 934 } ··· 954 942 955 943 battery = acpi_driver_data(device); 956 944 945 + mutex_lock(&battery->mutex); 946 + 957 947 status = acpi_remove_notify_handler(device->handle, 958 948 ACPI_ALL_NOTIFY, 959 949 acpi_battery_notify); ··· 966 952 967 953 kfree(battery->bst_data.pointer); 968 954 969 - mutex_destroy(&battery->lock); 955 + mutex_unlock(&battery->mutex); 956 + 957 + mutex_destroy(&battery->mutex); 970 958 971 959 kfree(battery); 972 960
+4 -6
drivers/acpi/bus.c
··· 276 276 Event Management 277 277 -------------------------------------------------------------------------- */ 278 278 279 + #ifdef CONFIG_ACPI_PROC_EVENT 279 280 static DEFINE_SPINLOCK(acpi_bus_event_lock); 280 281 281 282 LIST_HEAD(acpi_bus_event_list); ··· 284 283 285 284 extern int event_is_open; 286 285 287 - int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data) 286 + int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) 288 287 { 289 288 struct acpi_bus_event *event = NULL; 290 289 unsigned long flags = 0; ··· 292 291 293 292 if (!device) 294 293 return -EINVAL; 295 - 296 - if (acpi_bus_generate_genetlink_event(device, type, data)) 297 - printk(KERN_WARNING PREFIX 298 - "Failed to generate an ACPI event via genetlink!\n"); 299 294 300 295 /* drop event on the floor if no one's listening */ 301 296 if (!event_is_open) ··· 315 318 return 0; 316 319 } 317 320 318 - EXPORT_SYMBOL(acpi_bus_generate_event); 321 + EXPORT_SYMBOL(acpi_bus_generate_proc_event); 319 322 320 323 int acpi_bus_receive_event(struct acpi_bus_event *event) 321 324 { ··· 361 364 } 362 365 363 366 EXPORT_SYMBOL(acpi_bus_receive_event); 367 + #endif /* CONFIG_ACPI_PROC_EVENT */ 364 368 365 369 /* -------------------------------------------------------------------------- 366 370 Notification Handling
+1 -1
drivers/acpi/button.c
··· 284 284 } 285 285 input_sync(input); 286 286 287 - acpi_bus_generate_event(button->device, event, 287 + acpi_bus_generate_proc_event(button->device, event, 288 288 ++button->pushed); 289 289 break; 290 290 default:
+31 -16
drivers/acpi/ec.c
··· 696 696 return AE_CTRL_TERMINATE; 697 697 } 698 698 699 - static void ec_remove_handlers(struct acpi_ec *ec) 700 - { 701 - acpi_remove_address_space_handler(ec->handle, 702 - ACPI_ADR_SPACE_EC, 703 - &acpi_ec_space_handler); 704 - acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler); 705 - } 706 - 707 699 static int acpi_ec_add(struct acpi_device *device) 708 700 { 709 701 struct acpi_ec *ec = NULL; ··· 719 727 /* Check if we found the boot EC */ 720 728 if (boot_ec) { 721 729 if (boot_ec->gpe == ec->gpe) { 722 - ec_remove_handlers(boot_ec); 723 - mutex_destroy(&boot_ec->lock); 724 - kfree(boot_ec); 725 - first_ec = boot_ec = NULL; 730 + /* We might have incorrect info for GL at boot time */ 731 + mutex_lock(&boot_ec->lock); 732 + boot_ec->global_lock = ec->global_lock; 733 + /* Copy handlers from new ec into boot ec */ 734 + list_splice(&ec->list, &boot_ec->list); 735 + mutex_unlock(&boot_ec->lock); 736 + kfree(ec); 737 + ec = boot_ec; 726 738 } 727 - } 728 - if (!first_ec) 739 + } else 729 740 first_ec = ec; 730 741 ec->handle = device->handle; 731 742 acpi_driver_data(device) = ec; ··· 757 762 if (ec == first_ec) 758 763 first_ec = NULL; 759 764 765 + /* Don't touch boot EC */ 766 + if (boot_ec != ec) 767 + kfree(ec); 760 768 return 0; 761 769 } 762 770 ··· 823 825 if (!ec) 824 826 return -EINVAL; 825 827 826 - ret = ec_install_handlers(ec); 828 + /* Boot EC is already working */ 829 + if (ec != boot_ec) 830 + ret = ec_install_handlers(ec); 827 831 828 832 /* EC is fully operational, allow queries */ 829 833 atomic_set(&ec->query_pending, 0); ··· 835 835 836 836 static int acpi_ec_stop(struct acpi_device *device, int type) 837 837 { 838 + acpi_status status; 838 839 struct acpi_ec *ec; 839 840 840 841 if (!device) ··· 844 843 ec = acpi_driver_data(device); 845 844 if (!ec) 846 845 return -EINVAL; 847 - ec_remove_handlers(ec); 846 + 847 + /* Don't touch boot EC */ 848 + if (ec == boot_ec) 849 + return 0; 850 + 851 + status = acpi_remove_address_space_handler(ec->handle, 852 + ACPI_ADR_SPACE_EC, 853 + &acpi_ec_space_handler); 854 + if (ACPI_FAILURE(status)) 855 + return -ENODEV; 856 + 857 + status = acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler); 858 + if (ACPI_FAILURE(status)) 859 + return -ENODEV; 860 + 848 861 return 0; 849 862 } 850 863
+17 -5
drivers/acpi/event.c
··· 17 17 #define _COMPONENT ACPI_SYSTEM_COMPONENT 18 18 ACPI_MODULE_NAME("event"); 19 19 20 + #ifdef CONFIG_ACPI_PROC_EVENT 20 21 /* Global vars for handling event proc entry */ 21 22 static DEFINE_SPINLOCK(acpi_system_event_lock); 22 23 int event_is_open = 0; ··· 107 106 .release = acpi_system_close_event, 108 107 .poll = acpi_system_poll_event, 109 108 }; 109 + #endif /* CONFIG_ACPI_PROC_EVENT */ 110 110 111 111 #ifdef CONFIG_NET 112 112 static unsigned int acpi_event_seqnum; ··· 149 147 .name = ACPI_GENL_MCAST_GROUP_NAME, 150 148 }; 151 149 152 - int acpi_bus_generate_genetlink_event(struct acpi_device *device, 150 + int acpi_bus_generate_netlink_event(const char *device_class, 151 + const char *bus_id, 153 152 u8 type, int data) 154 153 { 155 154 struct sk_buff *skb; ··· 194 191 195 192 memset(event, 0, sizeof(struct acpi_genl_event)); 196 193 197 - strcpy(event->device_class, device->pnp.device_class); 198 - strcpy(event->bus_id, device->dev.bus_id); 194 + strcpy(event->device_class, device_class); 195 + strcpy(event->bus_id, bus_id); 199 196 event->type = type; 200 197 event->data = data; 201 198 ··· 214 211 return 0; 215 212 } 216 213 214 + EXPORT_SYMBOL(acpi_bus_generate_netlink_event); 215 + 217 216 static int acpi_event_genetlink_init(void) 218 217 { 219 218 int result; ··· 233 228 } 234 229 235 230 #else 236 - int acpi_bus_generate_genetlink_event(struct acpi_device *device, u8 type, 237 - int data) 231 + int acpi_bus_generate_netlink_event(const char *device_class, 232 + const char *bus_id, 233 + u8 type, int data) 238 234 { 239 235 return 0; 240 236 } 237 + 238 + EXPORT_SYMBOL(acpi_generate_netlink_event); 241 239 242 240 static int acpi_event_genetlink_init(void) 243 241 { ··· 250 242 251 243 static int __init acpi_event_init(void) 252 244 { 245 + #ifdef CONFIG_ACPI_PROC_EVENT 253 246 struct proc_dir_entry *entry; 247 + #endif 254 248 int error = 0; 255 249 256 250 if (acpi_disabled) ··· 264 254 printk(KERN_WARNING PREFIX 265 255 "Failed to create genetlink family for ACPI event\n"); 266 256 257 + #ifdef CONFIG_ACPI_PROC_EVENT 267 258 /* 'event' [R] */ 268 259 entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); 269 260 if (entry) 270 261 entry->proc_fops = &acpi_system_event_ops; 271 262 else 272 263 return -ENODEV; 264 + #endif 273 265 274 266 return 0; 275 267 }
+11 -8
drivers/acpi/hardware/hwsleep.c
··· 576 576 ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS")); 577 577 } 578 578 579 - status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL); 580 - if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { 581 - ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK")); 582 - } 583 - /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ 584 - 585 579 /* 580 + * GPEs must be enabled before _WAK is called as GPEs 581 + * might get fired there 582 + * 586 583 * Restore the GPEs: 587 584 * 1) Disable/Clear all GPEs 588 585 * 2) Enable all runtime GPEs ··· 588 591 if (ACPI_FAILURE(status)) { 589 592 return_ACPI_STATUS(status); 590 593 } 591 - acpi_gbl_system_awake_and_running = TRUE; 592 - 593 594 status = acpi_hw_enable_all_runtime_gpes(); 594 595 if (ACPI_FAILURE(status)) { 595 596 return_ACPI_STATUS(status); 596 597 } 598 + 599 + status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL); 600 + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { 601 + ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK")); 602 + } 603 + /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ 604 + 605 + acpi_gbl_system_awake_and_running = TRUE; 597 606 598 607 /* Enable power button */ 599 608
+1 -1
drivers/acpi/namespace/nsxfeval.c
··· 540 540 ******************************************************************************/ 541 541 542 542 acpi_status 543 - acpi_get_devices(char *HID, 543 + acpi_get_devices(const char *HID, 544 544 acpi_walk_callback user_function, 545 545 void *context, void **return_value) 546 546 {
+10 -3
drivers/acpi/processor_core.c
··· 698 698 switch (event) { 699 699 case ACPI_PROCESSOR_NOTIFY_PERFORMANCE: 700 700 acpi_processor_ppc_has_changed(pr); 701 - acpi_bus_generate_event(device, event, 701 + acpi_bus_generate_proc_event(device, event, 702 702 pr->performance_platform_limit); 703 + acpi_bus_generate_netlink_event(device->pnp.device_class, 704 + device->dev.bus_id, event, 705 + pr->performance_platform_limit); 703 706 break; 704 707 case ACPI_PROCESSOR_NOTIFY_POWER: 705 708 acpi_processor_cst_has_changed(pr); 706 - acpi_bus_generate_event(device, event, 0); 709 + acpi_bus_generate_proc_event(device, event, 0); 710 + acpi_bus_generate_netlink_event(device->pnp.device_class, 711 + device->dev.bus_id, event, 0); 707 712 break; 708 713 case ACPI_PROCESSOR_NOTIFY_THROTTLING: 709 714 acpi_processor_tstate_has_changed(pr); 710 - acpi_bus_generate_event(device, event, 0); 715 + acpi_bus_generate_proc_event(device, event, 0); 716 + acpi_bus_generate_netlink_event(device->pnp.device_class, 717 + device->dev.bus_id, event, 0); 711 718 default: 712 719 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 713 720 "Unsupported event [0x%x]\n", event));
+2 -1
drivers/acpi/sbs.c
··· 440 440 strcpy(acpi_device_bid(device), bid); 441 441 strcpy(acpi_device_class(device), class); 442 442 443 - result = acpi_bus_generate_event(device, event, state); 443 + result = acpi_bus_generate_proc_event(device, event, state); 444 444 445 445 strcpy(acpi_device_bid(device), bid_saved); 446 446 strcpy(acpi_device_class(device), class_saved); 447 447 448 + acpi_bus_generate_netlink_event(class, bid, event, state); 448 449 return result; 449 450 } 450 451
+3 -2
drivers/acpi/scan.c
··· 35 35 * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get: 36 36 * char *modalias: "acpi:IBM0001:ACPI0001" 37 37 */ 38 - int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size){ 39 - 38 + static int create_modalias(struct acpi_device *acpi_dev, char *modalias, 39 + int size) 40 + { 40 41 int len; 41 42 42 43 if (!acpi_dev->flags.hardware_id)
+1 -1
drivers/acpi/sleep/main.c
··· 305 305 unsigned long d_min, d_max; 306 306 307 307 if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { 308 - printk(KERN_ERR "ACPI handle has no context!\n"); 308 + printk(KERN_DEBUG "ACPI handle has no context!\n"); 309 309 return -ENODEV; 310 310 } 311 311
+71
drivers/acpi/tables/tbutils.c
··· 51 51 static acpi_physical_address 52 52 acpi_tb_get_root_table_entry(u8 * table_entry, 53 53 acpi_native_uint table_entry_size); 54 + /******************************************************************************* 55 + * 56 + * FUNCTION: acpi_tb_check_xsdt 57 + * 58 + * PARAMETERS: address - Pointer to the XSDT 59 + * 60 + * RETURN: status 61 + * AE_OK - XSDT is okay 62 + * AE_NO_MEMORY - can't map XSDT 63 + * AE_INVALID_TABLE_LENGTH - invalid table length 64 + * AE_NULL_ENTRY - XSDT has NULL entry 65 + * 66 + * DESCRIPTION: validate XSDT 67 + ******************************************************************************/ 68 + 69 + static acpi_status 70 + acpi_tb_check_xsdt(acpi_physical_address address) 71 + { 72 + struct acpi_table_header *table; 73 + u32 length; 74 + u64 xsdt_entry_address; 75 + u8 *table_entry; 76 + u32 table_count; 77 + int i; 78 + 79 + table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); 80 + if (!table) 81 + return AE_NO_MEMORY; 82 + 83 + length = table->length; 84 + acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); 85 + if (length < sizeof(struct acpi_table_header)) 86 + return AE_INVALID_TABLE_LENGTH; 87 + 88 + table = acpi_os_map_memory(address, length); 89 + if (!table) 90 + return AE_NO_MEMORY; 91 + 92 + /* Calculate the number of tables described in XSDT */ 93 + table_count = 94 + (u32) ((table->length - 95 + sizeof(struct acpi_table_header)) / sizeof(u64)); 96 + table_entry = 97 + ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); 98 + for (i = 0; i < table_count; i++) { 99 + ACPI_MOVE_64_TO_64(&xsdt_entry_address, table_entry); 100 + if (!xsdt_entry_address) { 101 + /* XSDT has NULL entry */ 102 + break; 103 + } 104 + table_entry += sizeof(u64); 105 + } 106 + acpi_os_unmap_memory(table, length); 107 + 108 + if (i < table_count) 109 + return AE_NULL_ENTRY; 110 + else 111 + return AE_OK; 112 + } 54 113 55 114 /******************************************************************************* 56 115 * ··· 400 341 u32 table_count; 401 342 struct acpi_table_header *table; 402 343 acpi_physical_address address; 344 + acpi_physical_address rsdt_address; 403 345 u32 length; 404 346 u8 *table_entry; 405 347 acpi_status status; ··· 429 369 */ 430 370 address = (acpi_physical_address) rsdp->xsdt_physical_address; 431 371 table_entry_size = sizeof(u64); 372 + rsdt_address = (acpi_physical_address) 373 + rsdp->rsdt_physical_address; 432 374 } else { 433 375 /* Root table is an RSDT (32-bit physical addresses) */ 434 376 ··· 444 382 */ 445 383 acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp)); 446 384 385 + if (table_entry_size == sizeof(u64)) { 386 + if (acpi_tb_check_xsdt(address) == AE_NULL_ENTRY) { 387 + /* XSDT has NULL entry, RSDT is used */ 388 + address = rsdt_address; 389 + table_entry_size = sizeof(u32); 390 + ACPI_WARNING((AE_INFO, "BIOS XSDT has NULL entry," 391 + "using RSDT")); 392 + } 393 + } 447 394 /* Map the RSDT/XSDT table header to get the full table length */ 448 395 449 396 table = acpi_os_map_memory(address, sizeof(struct acpi_table_header));
+56 -11
drivers/acpi/thermal.c
··· 77 77 78 78 static int act; 79 79 module_param(act, int, 0644); 80 - MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n"); 80 + MODULE_PARM_DESC(act, "Disable or override all lowest active trip points."); 81 + 82 + static int crt; 83 + module_param(crt, int, 0644); 84 + MODULE_PARM_DESC(crt, "Disable or lower all critical trip points."); 81 85 82 86 static int tzp; 83 87 module_param(tzp, int, 0444); 84 - MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); 88 + MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds."); 85 89 86 90 static int nocrt; 87 91 module_param(nocrt, int, 0); 88 - MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.\n"); 92 + MODULE_PARM_DESC(nocrt, "Set to take no action upon ACPI thermal zone critical trips points."); 89 93 90 94 static int off; 91 95 module_param(off, int, 0); 92 - MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n"); 96 + MODULE_PARM_DESC(off, "Set to disable ACPI thermal support."); 93 97 94 98 static int psv; 95 99 module_param(psv, int, 0644); 96 - MODULE_PARM_DESC(psv, "Disable or override all passive trip points.\n"); 100 + MODULE_PARM_DESC(psv, "Disable or override all passive trip points."); 97 101 98 102 static int acpi_thermal_add(struct acpi_device *device); 99 103 static int acpi_thermal_remove(struct acpi_device *device, int type); ··· 344 340 tz->trips.critical.temperature)); 345 341 } 346 342 343 + if (tz->trips.critical.flags.valid == 1) { 344 + if (crt == -1) { 345 + tz->trips.critical.flags.valid = 0; 346 + } else if (crt > 0) { 347 + unsigned long crt_k = CELSIUS_TO_KELVIN(crt); 348 + 349 + /* 350 + * Allow override to lower critical threshold 351 + */ 352 + if (crt_k < tz->trips.critical.temperature) 353 + tz->trips.critical.temperature = crt_k; 354 + } 355 + } 356 + 347 357 /* Critical Sleep (optional) */ 348 358 349 359 status = ··· 503 485 printk(KERN_EMERG 504 486 "Critical temperature reached (%ld C), shutting down.\n", 505 487 KELVIN_TO_CELSIUS(tz->temperature)); 506 - acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, 488 + acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, 507 489 tz->trips.critical.flags.enabled); 490 + acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 491 + tz->device->dev.bus_id, 492 + ACPI_THERMAL_NOTIFY_CRITICAL, 493 + tz->trips.critical.flags.enabled); 508 494 509 495 orderly_poweroff(true); 510 496 ··· 526 504 } else if (tz->trips.hot.flags.enabled) 527 505 tz->trips.hot.flags.enabled = 0; 528 506 529 - acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, 507 + acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, 530 508 tz->trips.hot.flags.enabled); 509 + acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 510 + tz->device->dev.bus_id, 511 + ACPI_THERMAL_NOTIFY_HOT, 512 + tz->trips.hot.flags.enabled); 531 513 532 514 /* TBD: Call user-mode "sleep(S4)" function */ 533 515 ··· 1093 1067 entry->owner = THIS_MODULE; 1094 1068 } 1095 1069 1096 - /* 'trip_points' [R/W] */ 1070 + /* 'trip_points' [R] */ 1097 1071 entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS, 1098 - S_IFREG | S_IRUGO | S_IWUSR, 1072 + S_IRUGO, 1099 1073 acpi_device_dir(device)); 1100 1074 if (!entry) 1101 1075 return -ENODEV; ··· 1175 1149 case ACPI_THERMAL_NOTIFY_THRESHOLDS: 1176 1150 acpi_thermal_get_trip_points(tz); 1177 1151 acpi_thermal_check(tz); 1178 - acpi_bus_generate_event(device, event, 0); 1152 + acpi_bus_generate_proc_event(device, event, 0); 1153 + acpi_bus_generate_netlink_event(device->pnp.device_class, 1154 + device->dev.bus_id, event, 0); 1179 1155 break; 1180 1156 case ACPI_THERMAL_NOTIFY_DEVICES: 1181 1157 if (tz->flags.devices) 1182 1158 acpi_thermal_get_devices(tz); 1183 - acpi_bus_generate_event(device, event, 0); 1159 + acpi_bus_generate_proc_event(device, event, 0); 1160 + acpi_bus_generate_netlink_event(device->pnp.device_class, 1161 + device->dev.bus_id, event, 0); 1184 1162 break; 1185 1163 default: 1186 1164 ACPI_DEBUG_PRINT((ACPI_DB_INFO, ··· 1369 1339 } 1370 1340 return 0; 1371 1341 } 1342 + static int thermal_nocrt(struct dmi_system_id *d) { 1343 + 1344 + printk(KERN_NOTICE "ACPI: %s detected: " 1345 + "disabling all critical thermal trip point actions.\n", d->ident); 1346 + nocrt = 1; 1347 + return 0; 1348 + } 1372 1349 static int thermal_tzp(struct dmi_system_id *d) { 1373 1350 1374 1351 if (tzp == 0) { ··· 1422 1385 .matches = { 1423 1386 DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), 1424 1387 DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), 1388 + }, 1389 + }, 1390 + { 1391 + .callback = thermal_nocrt, 1392 + .ident = "Gigabyte GA-7ZX", 1393 + .matches = { 1394 + DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."), 1395 + DMI_MATCH(DMI_BOARD_NAME, "7ZX"), 1425 1396 }, 1426 1397 }, 1427 1398 {}
+1
drivers/acpi/utilities/utglobal.c
··· 126 126 "Unknown exception code: 0x%8.8X", status)); 127 127 128 128 exception = "UNKNOWN_STATUS_CODE"; 129 + dump_stack(); 129 130 } 130 131 131 132 return (ACPI_CAST_PTR(const char, exception));
+100 -9
drivers/acpi/video.c
··· 31 31 #include <linux/list.h> 32 32 #include <linux/proc_fs.h> 33 33 #include <linux/seq_file.h> 34 - 34 + #include <linux/input.h> 35 35 #include <linux/backlight.h> 36 36 #include <linux/video_output.h> 37 37 #include <asm/uaccess.h> ··· 138 138 struct semaphore sem; 139 139 struct list_head video_device_list; 140 140 struct proc_dir_entry *dir; 141 + struct input_dev *input; 142 + char phys[32]; /* for input device */ 141 143 }; 142 144 143 145 struct acpi_video_device_flags { ··· 1766 1764 { 1767 1765 struct acpi_video_bus *video = data; 1768 1766 struct acpi_device *device = NULL; 1767 + struct input_dev *input; 1768 + int keycode; 1769 + 1769 1770 1770 1771 printk("video bus notify\n"); 1771 1772 ··· 1776 1771 return; 1777 1772 1778 1773 device = video->device; 1774 + input = video->input; 1779 1775 1780 1776 switch (event) { 1781 1777 case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch, 1782 1778 * most likely via hotkey. */ 1783 - acpi_bus_generate_event(device, event, 0); 1779 + acpi_bus_generate_proc_event(device, event, 0); 1780 + keycode = KEY_SWITCHVIDEOMODE; 1784 1781 break; 1785 1782 1786 1783 case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video ··· 1790 1783 acpi_video_device_enumerate(video); 1791 1784 acpi_video_device_rebind(video); 1792 1785 acpi_video_switch_output(video, event); 1793 - acpi_bus_generate_event(device, event, 0); 1786 + acpi_bus_generate_proc_event(device, event, 0); 1787 + keycode = KEY_SWITCHVIDEOMODE; 1794 1788 break; 1795 1789 1796 1790 case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */ 1791 + acpi_video_switch_output(video, event); 1792 + acpi_bus_generate_proc_event(device, event, 0); 1793 + keycode = KEY_SWITCHVIDEOMODE; 1794 + break; 1797 1795 case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */ 1796 + acpi_video_switch_output(video, event); 1797 + acpi_bus_generate_proc_event(device, event, 0); 1798 + keycode = KEY_VIDEO_NEXT; 1799 + break; 1798 1800 case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */ 1799 1801 acpi_video_switch_output(video, event); 1800 - acpi_bus_generate_event(device, event, 0); 1802 + acpi_bus_generate_proc_event(device, event, 0); 1803 + keycode = KEY_VIDEO_PREV; 1801 1804 break; 1802 1805 1803 1806 default: 1807 + keycode = KEY_UNKNOWN; 1804 1808 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1805 1809 "Unsupported event [0x%x]\n", event)); 1806 1810 break; 1807 1811 } 1812 + 1813 + input_report_key(input, keycode, 1); 1814 + input_sync(input); 1815 + input_report_key(input, keycode, 0); 1816 + input_sync(input); 1808 1817 1809 1818 return; 1810 1819 } ··· 1829 1806 { 1830 1807 struct acpi_video_device *video_device = data; 1831 1808 struct acpi_device *device = NULL; 1809 + struct acpi_video_bus *bus; 1810 + struct input_dev *input; 1811 + int keycode; 1832 1812 1833 1813 if (!video_device) 1834 1814 return; 1835 1815 1836 1816 device = video_device->dev; 1817 + bus = video_device->video; 1818 + input = bus->input; 1837 1819 1838 1820 switch (event) { 1839 - case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */ 1840 - case ACPI_VIDEO_NOTIFY_PROBE: /* change in status (output device status) */ 1841 - acpi_bus_generate_event(device, event, 0); 1842 - break; 1843 1821 case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */ 1822 + acpi_video_switch_brightness(video_device, event); 1823 + acpi_bus_generate_proc_event(device, event, 0); 1824 + keycode = KEY_BRIGHTNESS_CYCLE; 1825 + break; 1844 1826 case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */ 1827 + acpi_video_switch_brightness(video_device, event); 1828 + acpi_bus_generate_proc_event(device, event, 0); 1829 + keycode = KEY_BRIGHTNESSUP; 1830 + break; 1845 1831 case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */ 1832 + acpi_video_switch_brightness(video_device, event); 1833 + acpi_bus_generate_proc_event(device, event, 0); 1834 + keycode = KEY_BRIGHTNESSDOWN; 1835 + break; 1846 1836 case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */ 1837 + acpi_video_switch_brightness(video_device, event); 1838 + acpi_bus_generate_proc_event(device, event, 0); 1839 + keycode = KEY_BRIGHTNESS_ZERO; 1840 + break; 1847 1841 case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */ 1848 1842 acpi_video_switch_brightness(video_device, event); 1849 - acpi_bus_generate_event(device, event, 0); 1843 + acpi_bus_generate_proc_event(device, event, 0); 1844 + keycode = KEY_DISPLAY_OFF; 1850 1845 break; 1851 1846 default: 1847 + keycode = KEY_UNKNOWN; 1852 1848 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1853 1849 "Unsupported event [0x%x]\n", event)); 1854 1850 break; 1855 1851 } 1852 + 1853 + input_report_key(input, keycode, 1); 1854 + input_sync(input); 1855 + input_report_key(input, keycode, 0); 1856 + input_sync(input); 1857 + 1856 1858 return; 1857 1859 } 1858 1860 1861 + static int instance; 1859 1862 static int acpi_video_bus_add(struct acpi_device *device) 1860 1863 { 1861 1864 int result = 0; 1862 1865 acpi_status status = 0; 1863 1866 struct acpi_video_bus *video = NULL; 1867 + struct input_dev *input; 1864 1868 1865 1869 1866 1870 if (!device) ··· 1896 1846 video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); 1897 1847 if (!video) 1898 1848 return -ENOMEM; 1849 + 1850 + /* a hack to fix the duplicate name "VID" problem on T61 */ 1851 + if (!strcmp(device->pnp.bus_id, "VID")) { 1852 + if (instance) 1853 + device->pnp.bus_id[3] = '0' + instance; 1854 + instance ++; 1855 + } 1899 1856 1900 1857 video->device = device; 1901 1858 strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); ··· 1938 1881 goto end; 1939 1882 } 1940 1883 1884 + 1885 + video->input = input = input_allocate_device(); 1886 + 1887 + snprintf(video->phys, sizeof(video->phys), 1888 + "%s/video/input0", acpi_device_hid(video->device)); 1889 + 1890 + input->name = acpi_device_name(video->device); 1891 + input->phys = video->phys; 1892 + input->id.bustype = BUS_HOST; 1893 + input->id.product = 0x06; 1894 + input->evbit[0] = BIT(EV_KEY); 1895 + set_bit(KEY_SWITCHVIDEOMODE, input->keybit); 1896 + set_bit(KEY_VIDEO_NEXT, input->keybit); 1897 + set_bit(KEY_VIDEO_PREV, input->keybit); 1898 + set_bit(KEY_BRIGHTNESS_CYCLE, input->keybit); 1899 + set_bit(KEY_BRIGHTNESSUP, input->keybit); 1900 + set_bit(KEY_BRIGHTNESSDOWN, input->keybit); 1901 + set_bit(KEY_BRIGHTNESS_ZERO, input->keybit); 1902 + set_bit(KEY_DISPLAY_OFF, input->keybit); 1903 + set_bit(KEY_UNKNOWN, input->keybit); 1904 + result = input_register_device(input); 1905 + if (result) { 1906 + acpi_remove_notify_handler(video->device->handle, 1907 + ACPI_DEVICE_NOTIFY, 1908 + acpi_video_bus_notify); 1909 + acpi_video_bus_stop_devices(video); 1910 + acpi_video_bus_put_devices(video); 1911 + kfree(video->attached_array); 1912 + acpi_video_bus_remove_fs(device); 1913 + goto end; 1914 + } 1915 + 1916 + 1941 1917 printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s rom: %s post: %s)\n", 1942 1918 ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device), 1943 1919 video->flags.multihead ? "yes" : "no", ··· 2004 1914 acpi_video_bus_put_devices(video); 2005 1915 acpi_video_bus_remove_fs(device); 2006 1916 1917 + input_unregister_device(video->input); 2007 1918 kfree(video->attached_array); 2008 1919 kfree(video); 2009 1920
+1 -1
drivers/char/sonypi.c
··· 875 875 876 876 #ifdef CONFIG_ACPI 877 877 if (sonypi_acpi_device) 878 - acpi_bus_generate_event(sonypi_acpi_device, 1, event); 878 + acpi_bus_generate_proc_event(sonypi_acpi_device, 1, event); 879 879 #endif 880 880 881 881 kfifo_put(sonypi_device.fifo, (unsigned char *)&event, sizeof(event));
+3 -2
drivers/misc/asus-laptop.c
··· 732 732 lcd_blank(FB_BLANK_POWERDOWN); 733 733 } 734 734 735 - acpi_bus_generate_event(hotk->device, event, 735 + acpi_bus_generate_proc_event(hotk->device, event, 736 736 hotk->event_count[event % 128]++); 737 737 738 738 return; ··· 1072 1072 } 1073 1073 1074 1074 #define ASUS_LED_UNREGISTER(object) \ 1075 - led_classdev_unregister(&object##_led) 1075 + if (object##_led.dev) \ 1076 + led_classdev_unregister(&object##_led) 1076 1077 1077 1078 static void asus_led_exit(void) 1078 1079 {
+20 -8
drivers/misc/sony-laptop.c
··· 856 856 }, 857 857 }, 858 858 { 859 + .ident = "Sony Vaio FZ Series", 860 + .callback = sony_nc_C_enable, 861 + .driver_data = sony_C_events, 862 + .matches = { 863 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 864 + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ"), 865 + }, 866 + }, 867 + { 859 868 .ident = "Sony Vaio C Series", 860 869 .callback = sony_nc_C_enable, 861 870 .driver_data = sony_C_events, ··· 913 904 914 905 dprintk("sony_acpi_notify, event: 0x%.2x\n", ev); 915 906 sony_laptop_report_input_event(ev); 916 - acpi_bus_generate_event(sony_nc_acpi_device, 1, ev); 907 + acpi_bus_generate_proc_event(sony_nc_acpi_device, 1, ev); 917 908 } 918 909 919 910 static acpi_status sony_walk_callback(acpi_handle handle, u32 level, ··· 2301 2292 2302 2293 found: 2303 2294 sony_laptop_report_input_event(device_event); 2304 - acpi_bus_generate_event(spic_dev.acpi_dev, 1, device_event); 2295 + acpi_bus_generate_proc_event(spic_dev.acpi_dev, 1, device_event); 2305 2296 sonypi_compat_report_event(device_event); 2306 2297 2307 2298 return IRQ_HANDLED; ··· 2317 2308 struct sony_pic_ioport *io, *tmp_io; 2318 2309 struct sony_pic_irq *irq, *tmp_irq; 2319 2310 2320 - sonypi_compat_exit(); 2321 - 2322 2311 if (sony_pic_disable(device)) { 2323 2312 printk(KERN_ERR DRV_PFX "Couldn't disable device.\n"); 2324 2313 return -ENXIO; ··· 2325 2318 free_irq(spic_dev.cur_irq->irq.interrupts[0], &spic_dev); 2326 2319 release_region(spic_dev.cur_ioport->io.minimum, 2327 2320 spic_dev.cur_ioport->io.address_length); 2321 + 2322 + sonypi_compat_exit(); 2328 2323 2329 2324 sony_laptop_remove_input(); 2330 2325 ··· 2393 2384 goto err_free_resources; 2394 2385 } 2395 2386 2387 + if (sonypi_compat_init()) 2388 + goto err_remove_input; 2389 + 2396 2390 /* request io port */ 2397 2391 list_for_each_entry(io, &spic_dev.ioports, list) { 2398 2392 if (request_region(io->io.minimum, io->io.address_length, ··· 2410 2398 if (!spic_dev.cur_ioport) { 2411 2399 printk(KERN_ERR DRV_PFX "Failed to request_region.\n"); 2412 2400 result = -ENODEV; 2413 - goto err_remove_input; 2401 + goto err_remove_compat; 2414 2402 } 2415 2403 2416 2404 /* request IRQ */ ··· 2450 2438 if (result) 2451 2439 goto err_remove_pf; 2452 2440 2453 - if (sonypi_compat_init()) 2454 - goto err_remove_pf; 2455 - 2456 2441 return 0; 2457 2442 2458 2443 err_remove_pf: ··· 2464 2455 err_release_region: 2465 2456 release_region(spic_dev.cur_ioport->io.minimum, 2466 2457 spic_dev.cur_ioport->io.address_length); 2458 + 2459 + err_remove_compat: 2460 + sonypi_compat_exit(); 2467 2461 2468 2462 err_remove_input: 2469 2463 sony_laptop_remove_input();
+17 -9
drivers/misc/thinkpad_acpi.c
··· 1190 1190 } 1191 1191 1192 1192 if (sendacpi) 1193 - acpi_bus_generate_event(ibm->acpi->device, event, hkey); 1193 + acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey); 1194 1194 } else { 1195 1195 printk(IBM_ERR "unknown hotkey notification event %d\n", event); 1196 - acpi_bus_generate_event(ibm->acpi->device, event, 0); 1196 + acpi_bus_generate_proc_event(ibm->acpi->device, event, 0); 1197 1197 } 1198 1198 } 1199 1199 ··· 2162 2162 int docked = dock_docked(); 2163 2163 int pci = ibm->acpi->hid && ibm->acpi->device && 2164 2164 acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids); 2165 + int data; 2165 2166 2166 2167 if (event == 1 && !pci) /* 570 */ 2167 - acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ 2168 + data = 1; /* button */ 2168 2169 else if (event == 1 && pci) /* 570 */ 2169 - acpi_bus_generate_event(ibm->acpi->device, event, 3); /* dock */ 2170 + data = 3; /* dock */ 2170 2171 else if (event == 3 && docked) 2171 - acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ 2172 + data = 1; /* button */ 2172 2173 else if (event == 3 && !docked) 2173 - acpi_bus_generate_event(ibm->acpi->device, event, 2); /* undock */ 2174 + data = 2; /* undock */ 2174 2175 else if (event == 0 && docked) 2175 - acpi_bus_generate_event(ibm->acpi->device, event, 3); /* dock */ 2176 + data = 3; /* dock */ 2176 2177 else { 2177 2178 printk(IBM_ERR "unknown dock event %d, status %d\n", 2178 2179 event, _sta(dock_handle)); 2179 - acpi_bus_generate_event(ibm->acpi->device, event, 0); /* unknown */ 2180 + data = 0; /* unknown */ 2180 2181 } 2182 + acpi_bus_generate_proc_event(ibm->acpi->device, event, data); 2183 + acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, 2184 + ibm->acpi->device->dev.bus_id, 2185 + event, data); 2181 2186 } 2182 2187 2183 2188 static int dock_read(char *p) ··· 2280 2275 2281 2276 static void bay_notify(struct ibm_struct *ibm, u32 event) 2282 2277 { 2283 - acpi_bus_generate_event(ibm->acpi->device, event, 0); 2278 + acpi_bus_generate_proc_event(ibm->acpi->device, event, 0); 2279 + acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, 2280 + ibm->acpi->device->dev.bus_id, 2281 + event, 0); 2284 2282 } 2285 2283 2286 2284 #define bay_occupied(b) (_sta(b##_handle) & 1)
+5 -2
drivers/pci/hotplug/acpiphp_ibm.c
··· 267 267 268 268 if (subevent == 0x80) { 269 269 dbg("%s: generationg bus event\n", __FUNCTION__); 270 - acpi_bus_generate_event(note->device, note->event, detail); 270 + acpi_bus_generate_proc_event(note->device, note->event, detail); 271 + acpi_bus_generate_netlink_event(note->device->pnp.device_class, 272 + note->device->dev.bus_id, 273 + note->event, detail); 271 274 } else 272 275 note->event = event; 273 276 } ··· 402 399 403 400 status = acpi_get_object_info(handle, &info_buffer); 404 401 if (ACPI_FAILURE(status)) { 405 - err("%s: Failed to get device information", __FUNCTION__); 402 + err("%s: Failed to get device information\n", __FUNCTION__); 406 403 return 0; 407 404 } 408 405 info.hardware_id.value[sizeof(info.hardware_id.value) - 1] = '\0';
+8 -8
drivers/pnp/card.c
··· 25 25 int found; 26 26 struct pnp_dev *dev; 27 27 28 - if (i == PNP_MAX_DEVICES 29 - || !*drv_id->devs[i].id) 28 + if (i == PNP_MAX_DEVICES || 29 + !*drv_id->devs[i].id) 30 30 return drv_id; 31 31 found = 0; 32 32 card_for_each_dev(card, dev) { 33 - if (compare_pnp_id 34 - (dev->id, drv_id->devs[i].id)) { 33 + if (compare_pnp_id(dev->id, 34 + drv_id->devs[i].id)) { 35 35 found = 1; 36 36 break; 37 37 } ··· 183 183 184 184 return 0; 185 185 186 - err_name: 186 + err_name: 187 187 device_remove_file(&card->dev, &dev_attr_name); 188 188 return rc; 189 189 } ··· 321 321 pos = pos->next; 322 322 } 323 323 324 - done: 324 + done: 325 325 return NULL; 326 326 327 - found: 327 + found: 328 328 dev->card_link = clink; 329 329 dev->dev.driver = &drv->link.driver; 330 330 if (pnp_bus_type.probe(&dev->dev)) ··· 334 334 335 335 return dev; 336 336 337 - err_out: 337 + err_out: 338 338 dev->dev.driver = NULL; 339 339 dev->card_link = NULL; 340 340 return NULL;
+1 -6
drivers/pnp/core.c
··· 52 52 int nodenum; 53 53 struct list_head *pos; 54 54 55 - if (!protocol) 56 - return -EINVAL; 57 - 58 55 INIT_LIST_HEAD(&protocol->devices); 59 56 INIT_LIST_HEAD(&protocol->cards); 60 57 nodenum = 0; ··· 91 94 struct pnp_id *id; 92 95 struct pnp_id *next; 93 96 94 - if (!dev) 95 - return; 96 97 id = dev->id; 97 98 while (id) { 98 99 next = id->next; ··· 138 143 */ 139 144 int pnp_add_device(struct pnp_dev *dev) 140 145 { 141 - if (!dev || !dev->protocol || dev->card) 146 + if (dev->card) 142 147 return -EINVAL; 143 148 dev->dev.parent = &dev->protocol->dev; 144 149 sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
+1 -5
drivers/pnp/driver.c
··· 118 118 goto fail; 119 119 return error; 120 120 121 - fail: 121 + fail: 122 122 pnp_device_detach(pnp_dev); 123 123 return error; 124 124 } ··· 232 232 { 233 233 struct pnp_id *ptr; 234 234 235 - if (!id) 236 - return -EINVAL; 237 - if (!dev) 238 - return -EINVAL; 239 235 id->next = NULL; 240 236 ptr = dev->id; 241 237 while (ptr && ptr->next)
+5 -4
drivers/pnp/interface.c
··· 459 459 up(&pnp_res_mutex); 460 460 goto done; 461 461 } 462 - done: 462 + 463 + done: 463 464 if (retval < 0) 464 465 return retval; 465 466 return count; ··· 500 499 501 500 return 0; 502 501 503 - err_res: 502 + err_res: 504 503 device_remove_file(&dev->dev, &dev_attr_resources); 505 - err_opt: 504 + err_opt: 506 505 device_remove_file(&dev->dev, &dev_attr_options); 507 - err: 506 + err: 508 507 return rc; 509 508 }
+7 -17
drivers/pnp/isapnp/core.c
··· 47 47 #if 0 48 48 #define ISAPNP_REGION_OK 49 49 #endif 50 - #if 0 51 - #define ISAPNP_DEBUG 52 - #endif 53 50 54 51 int isapnp_disable; /* Disable ISA PnP */ 55 52 static int isapnp_rdp; /* Read Data Port */ ··· 90 93 91 94 static unsigned char isapnp_checksum_value; 92 95 static DEFINE_MUTEX(isapnp_cfg_mutex); 93 - static int isapnp_detected; 94 96 static int isapnp_csn_count; 95 97 96 98 /* some prototypes */ ··· 331 335 } else if (iteration > 1) { 332 336 break; 333 337 } 334 - __next: 338 + __next: 335 339 if (csn == 255) 336 340 break; 337 341 checksum = 0x6a; ··· 729 733 "isapnp: unexpected or unknown tag type 0x%x for logical device %i (device %i), ignored\n", 730 734 type, dev->number, card->number); 731 735 } 732 - __skip: 736 + __skip: 733 737 if (size > 0) 734 738 isapnp_skip_bytes(size); 735 739 } ··· 784 788 "isapnp: unexpected or unknown tag type 0x%x for device %i, ignored\n", 785 789 type, card->number); 786 790 } 787 - __skip: 791 + __skip: 788 792 if (size > 0) 789 793 isapnp_skip_bytes(size); 790 794 } ··· 936 940 EXPORT_SYMBOL(isapnp_present); 937 941 EXPORT_SYMBOL(isapnp_cfg_begin); 938 942 EXPORT_SYMBOL(isapnp_cfg_end); 939 - #if 0 940 - EXPORT_SYMBOL(isapnp_read_byte); 941 - #endif 942 943 EXPORT_SYMBOL(isapnp_write_byte); 943 944 944 945 static int isapnp_read_resources(struct pnp_dev *dev, ··· 986 993 struct pnp_resource_table *res) 987 994 { 988 995 int ret; 996 + 989 997 pnp_init_resource_table(res); 990 998 isapnp_cfg_begin(dev->card->number, dev->number); 991 999 ret = isapnp_read_resources(dev, res); ··· 1040 1046 1041 1047 static int isapnp_disable_resources(struct pnp_dev *dev) 1042 1048 { 1043 - if (!dev || !dev->active) 1049 + if (!dev->active) 1044 1050 return -EINVAL; 1045 1051 isapnp_cfg_begin(dev->card->number, dev->number); 1046 1052 isapnp_deactivate(dev->number); ··· 1063 1069 struct pnp_dev *dev; 1064 1070 1065 1071 if (isapnp_disable) { 1066 - isapnp_detected = 0; 1067 1072 printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n"); 1068 1073 return 0; 1069 1074 } ··· 1110 1117 } 1111 1118 isapnp_set_rdp(); 1112 1119 } 1113 - isapnp_detected = 1; 1114 1120 if (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff) { 1115 1121 cards = isapnp_isolate(); 1116 1122 if (cards < 0 || (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff)) { ··· 1117 1125 release_region(_PIDXR, 1); 1118 1126 #endif 1119 1127 release_region(_PNPWRP, 1); 1120 - isapnp_detected = 0; 1121 1128 printk(KERN_INFO 1122 1129 "isapnp: No Plug & Play device found\n"); 1123 1130 return 0; ··· 1139 1148 } 1140 1149 } 1141 1150 } 1142 - if (cards) { 1151 + if (cards) 1143 1152 printk(KERN_INFO 1144 1153 "isapnp: %i Plug & Play card%s detected total\n", cards, 1145 1154 cards > 1 ? "s" : ""); 1146 - } else { 1155 + else 1147 1156 printk(KERN_INFO "isapnp: No Plug & Play card found\n"); 1148 - } 1149 1157 1150 1158 isapnp_proc_init(); 1151 1159 return 0;
-45
drivers/pnp/isapnp/proc.c
··· 112 112 return 0; 113 113 } 114 114 115 - #ifdef MODULE 116 - static int __exit isapnp_proc_detach_device(struct pnp_dev *dev) 117 - { 118 - struct pnp_card *bus = dev->card; 119 - struct proc_dir_entry *de; 120 - char name[16]; 121 - 122 - if (!(de = bus->procdir)) 123 - return -EINVAL; 124 - sprintf(name, "%02x", dev->number); 125 - remove_proc_entry(name, de); 126 - return 0; 127 - } 128 - 129 - static int __exit isapnp_proc_detach_bus(struct pnp_card *bus) 130 - { 131 - struct proc_dir_entry *de; 132 - char name[16]; 133 - 134 - if (!(de = bus->procdir)) 135 - return -EINVAL; 136 - sprintf(name, "%02x", bus->number); 137 - remove_proc_entry(name, isapnp_proc_bus_dir); 138 - return 0; 139 - } 140 - #endif /* MODULE */ 141 - 142 115 int __init isapnp_proc_init(void) 143 116 { 144 117 struct pnp_dev *dev; ··· 122 149 } 123 150 return 0; 124 151 } 125 - 126 - #ifdef MODULE 127 - int __exit isapnp_proc_done(void) 128 - { 129 - struct pnp_dev *dev; 130 - struct pnp_bus *card; 131 - 132 - isapnp_for_each_dev(dev) { 133 - isapnp_proc_detach_device(dev); 134 - } 135 - isapnp_for_each_card(card) { 136 - isapnp_proc_detach_bus(card); 137 - } 138 - if (isapnp_proc_bus_dir) 139 - remove_proc_entry("isapnp", proc_bus); 140 - return 0; 141 - } 142 - #endif /* MODULE */
+2 -25
drivers/pnp/manager.c
··· 21 21 resource_size_t *start, *end; 22 22 unsigned long *flags; 23 23 24 - if (!dev || !rule) 25 - return -EINVAL; 26 - 27 24 if (idx >= PNP_MAX_PORT) { 28 25 pnp_err 29 26 ("More than 4 ports is incompatible with pnp specifications."); ··· 62 65 { 63 66 resource_size_t *start, *end; 64 67 unsigned long *flags; 65 - 66 - if (!dev || !rule) 67 - return -EINVAL; 68 68 69 69 if (idx >= PNP_MAX_MEM) { 70 70 pnp_err ··· 121 127 5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2 122 128 }; 123 129 124 - if (!dev || !rule) 125 - return -EINVAL; 126 - 127 130 if (idx >= PNP_MAX_IRQ) { 128 131 pnp_err 129 132 ("More than 2 irqs is incompatible with pnp specifications."); ··· 171 180 static unsigned short xtab[8] = { 172 181 1, 3, 5, 6, 7, 0, 2, 4 173 182 }; 174 - 175 - if (!dev || !rule) 176 - return -EINVAL; 177 183 178 184 if (idx >= PNP_MAX_DMA) { 179 185 pnp_err ··· 378 390 up(&pnp_res_mutex); 379 391 return 1; 380 392 381 - fail: 393 + fail: 382 394 pnp_clean_resource_table(&dev->res); 383 395 up(&pnp_res_mutex); 384 396 return 0; ··· 398 410 int i; 399 411 struct pnp_resource_table *bak; 400 412 401 - if (!dev || !res) 402 - return -EINVAL; 403 413 if (!pnp_can_configure(dev)) 404 414 return -ENODEV; 405 415 bak = pnp_alloc(sizeof(struct pnp_resource_table)); ··· 430 444 kfree(bak); 431 445 return 0; 432 446 433 - fail: 447 + fail: 434 448 dev->res = *bak; 435 449 up(&pnp_res_mutex); 436 450 kfree(bak); ··· 445 459 { 446 460 struct pnp_option *dep; 447 461 int i = 1; 448 - 449 - if (!dev) 450 - return -EINVAL; 451 462 452 463 if (!pnp_can_configure(dev)) { 453 464 pnp_dbg("Device %s does not support resource configuration.", ··· 524 541 { 525 542 int error; 526 543 527 - if (!dev) 528 - return -EINVAL; 529 544 if (dev->active) 530 545 return 0; /* the device is already active */ 531 546 ··· 549 568 { 550 569 int error; 551 570 552 - if (!dev) 553 - return -EINVAL; 554 571 if (!dev->active) 555 572 return 0; /* the device is already disabled */ 556 573 ··· 575 596 void pnp_resource_change(struct resource *resource, resource_size_t start, 576 597 resource_size_t size) 577 598 { 578 - if (resource == NULL) 579 - return; 580 599 resource->flags &= ~(IORESOURCE_AUTO | IORESOURCE_UNSET); 581 600 resource->start = start; 582 601 resource->end = start + size - 1;
+2 -2
drivers/pnp/pnpacpi/core.c
··· 248 248 num++; 249 249 250 250 return AE_OK; 251 - err1: 251 + err1: 252 252 kfree(dev_id); 253 - err: 253 + err: 254 254 kfree(dev); 255 255 return -EINVAL; 256 256 }
+9 -14
drivers/pnp/pnpacpi/rsparser.c
··· 34 34 */ 35 35 static int irq_flags(int triggering, int polarity) 36 36 { 37 - int flag; 38 37 if (triggering == ACPI_LEVEL_SENSITIVE) { 39 38 if (polarity == ACPI_ACTIVE_LOW) 40 - flag = IORESOURCE_IRQ_LOWLEVEL; 39 + return IORESOURCE_IRQ_LOWLEVEL; 41 40 else 42 - flag = IORESOURCE_IRQ_HIGHLEVEL; 41 + return IORESOURCE_IRQ_HIGHLEVEL; 43 42 } else { 44 43 if (polarity == ACPI_ACTIVE_LOW) 45 - flag = IORESOURCE_IRQ_LOWEDGE; 44 + return IORESOURCE_IRQ_LOWEDGE; 46 45 else 47 - flag = IORESOURCE_IRQ_HIGHEDGE; 46 + return IORESOURCE_IRQ_HIGHEDGE; 48 47 } 49 - return flag; 50 48 } 51 49 52 50 static void decode_irq_flags(int flag, int *triggering, int *polarity) ··· 240 242 static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, 241 243 void *data) 242 244 { 243 - struct pnp_resource_table *res_table = 244 - (struct pnp_resource_table *)data; 245 + struct pnp_resource_table *res_table = data; 245 246 int i; 246 247 247 248 switch (res->type) { ··· 563 566 void *data) 564 567 { 565 568 int priority = 0; 566 - struct acpipnp_parse_option_s *parse_data = 567 - (struct acpipnp_parse_option_s *)data; 569 + struct acpipnp_parse_option_s *parse_data = data; 568 570 struct pnp_dev *dev = parse_data->dev; 569 571 struct pnp_option *option = parse_data->option; 570 572 ··· 701 705 static acpi_status pnpacpi_count_resources(struct acpi_resource *res, 702 706 void *data) 703 707 { 704 - int *res_cnt = (int *)data; 708 + int *res_cnt = data; 705 709 706 710 if (pnpacpi_supported_resource(res)) 707 711 (*res_cnt)++; ··· 710 714 711 715 static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data) 712 716 { 713 - struct acpi_resource **resource = (struct acpi_resource **)data; 717 + struct acpi_resource **resource = data; 714 718 715 719 if (pnpacpi_supported_resource(res)) { 716 720 (*resource)->type = res->type; ··· 882 886 int i = 0; 883 887 /* pnpacpi_build_resource_template allocates extra mem */ 884 888 int res_cnt = (buffer->length - 1) / sizeof(struct acpi_resource) - 1; 885 - struct acpi_resource *resource = 886 - (struct acpi_resource *)buffer->pointer; 889 + struct acpi_resource *resource = buffer->pointer; 887 890 int port = 0, irq = 0, dma = 0, mem = 0; 888 891 889 892 pnp_dbg("res cnt %d", res_cnt);
+1 -43
drivers/pnp/pnpbios/core.c
··· 419 419 static int pnpbios_disabled; 420 420 int pnpbios_dont_use_current_config; 421 421 422 - #ifndef MODULE 423 422 static int __init pnpbios_setup(char *str) 424 423 { 425 424 int invert; ··· 442 443 } 443 444 444 445 __setup("pnpbios=", pnpbios_setup); 445 - #endif 446 446 447 447 /* PnP BIOS signature: "$PnP" */ 448 448 #define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24)) ··· 589 591 static int __init pnpbios_thread_init(void) 590 592 { 591 593 struct task_struct *task; 594 + 592 595 #if defined(CONFIG_PPC_MERGE) 593 596 if (check_legacy_ioport(PNPBIOS_BASE)) 594 597 return 0; ··· 605 606 return 0; 606 607 } 607 608 608 - #ifndef MODULE 609 - 610 - /* init/main.c calls pnpbios_init early */ 611 - 612 609 /* Start the kernel thread later: */ 613 610 module_init(pnpbios_thread_init); 614 - 615 - #else 616 - 617 - /* 618 - * N.B.: Building pnpbios as a module hasn't been fully implemented 619 - */ 620 - 621 - MODULE_LICENSE("GPL"); 622 - 623 - static int __init pnpbios_init_all(void) 624 - { 625 - int r; 626 - 627 - r = pnpbios_init(); 628 - if (r) 629 - return r; 630 - r = pnpbios_thread_init(); 631 - if (r) 632 - return r; 633 - return 0; 634 - } 635 - 636 - static void __exit pnpbios_exit(void) 637 - { 638 - #ifdef CONFIG_HOTPLUG 639 - unloading = 1; 640 - wait_for_completion(&unload_sem); 641 - #endif 642 - pnpbios_proc_exit(); 643 - /* We ought to free resources here */ 644 - return; 645 - } 646 - 647 - module_init(pnpbios_init_all); 648 - module_exit(pnpbios_exit); 649 - 650 - #endif 651 611 652 612 EXPORT_SYMBOL(pnpbios_protocol);
+1 -1
drivers/pnp/pnpbios/proc.c
··· 212 212 goto out; 213 213 } 214 214 ret = count; 215 - out: 215 + out: 216 216 kfree(node); 217 217 return ret; 218 218 }
+5 -4
drivers/pnp/pnpbios/rsparser.c
··· 238 238 break; 239 239 240 240 default: /* an unkown tag */ 241 - len_err: 241 + len_err: 242 242 printk(KERN_ERR 243 243 "PnPBIOS: Unknown tag '0x%x', length '%d'.\n", 244 244 tag, len); ··· 298 298 struct pnp_option *option) 299 299 { 300 300 struct pnp_mem *mem; 301 + 301 302 mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); 302 303 if (!mem) 303 304 return; ··· 469 468 return p + 2; 470 469 471 470 default: /* an unkown tag */ 472 - len_err: 471 + len_err: 473 472 printk(KERN_ERR 474 473 "PnPBIOS: Unknown tag '0x%x', length '%d'.\n", 475 474 tag, len); ··· 563 562 break; 564 563 565 564 default: /* an unkown tag */ 566 - len_err: 565 + len_err: 567 566 printk(KERN_ERR 568 567 "PnPBIOS: Unknown tag '0x%x', length '%d'.\n", 569 568 tag, len); ··· 757 756 break; 758 757 759 758 default: /* an unkown tag */ 760 - len_err: 759 + len_err: 761 760 printk(KERN_ERR 762 761 "PnPBIOS: Unknown tag '0x%x', length '%d'.\n", 763 762 tag, len);
-26
drivers/pnp/resource.c
··· 47 47 { 48 48 struct pnp_option *option; 49 49 50 - if (!dev) 51 - return NULL; 52 - 53 50 option = pnp_build_option(PNP_RES_PRIORITY_PREFERRED); 54 51 55 52 /* this should never happen but if it does we'll try to continue */ ··· 60 63 int priority) 61 64 { 62 65 struct pnp_option *option; 63 - 64 - if (!dev) 65 - return NULL; 66 66 67 67 option = pnp_build_option(priority); 68 68 ··· 76 82 int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) 77 83 { 78 84 struct pnp_irq *ptr; 79 - 80 - if (!option) 81 - return -EINVAL; 82 - if (!data) 83 - return -EINVAL; 84 85 85 86 ptr = option->irq; 86 87 while (ptr && ptr->next) ··· 101 112 { 102 113 struct pnp_dma *ptr; 103 114 104 - if (!option) 105 - return -EINVAL; 106 - if (!data) 107 - return -EINVAL; 108 - 109 115 ptr = option->dma; 110 116 while (ptr && ptr->next) 111 117 ptr = ptr->next; ··· 116 132 { 117 133 struct pnp_port *ptr; 118 134 119 - if (!option) 120 - return -EINVAL; 121 - if (!data) 122 - return -EINVAL; 123 - 124 135 ptr = option->port; 125 136 while (ptr && ptr->next) 126 137 ptr = ptr->next; ··· 130 151 int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) 131 152 { 132 153 struct pnp_mem *ptr; 133 - 134 - if (!option) 135 - return -EINVAL; 136 - if (!data) 137 - return -EINVAL; 138 154 139 155 ptr = option->mem; 140 156 while (ptr && ptr->next)
+7 -3
include/acpi/acpi_bus.h
··· 321 321 }; 322 322 323 323 extern struct kset acpi_subsys; 324 - extern int acpi_bus_generate_genetlink_event(struct acpi_device *device, 325 - u8 type, int data); 324 + extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); 326 325 /* 327 326 * External Functions 328 327 */ ··· 331 332 int acpi_bus_get_status(struct acpi_device *device); 332 333 int acpi_bus_get_power(acpi_handle handle, int *state); 333 334 int acpi_bus_set_power(acpi_handle handle, int state); 334 - int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); 335 + #ifdef CONFIG_ACPI_PROC_EVENT 336 + int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); 335 337 int acpi_bus_receive_event(struct acpi_bus_event *event); 338 + #else 339 + static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) 340 + { return 0; } 341 + #endif 336 342 int acpi_bus_register_driver(struct acpi_driver *driver); 337 343 void acpi_bus_unregister_driver(struct acpi_driver *driver); 338 344 int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
+1 -1
include/acpi/acpixf.h
··· 130 130 void *context, void **return_value); 131 131 132 132 acpi_status 133 - acpi_get_devices(char *HID, 133 + acpi_get_devices(const char *HID, 134 134 acpi_walk_callback user_function, 135 135 void *context, void **return_value); 136 136
+1 -1
include/acpi/acstruct.h
··· 146 146 struct acpi_get_devices_info { 147 147 acpi_walk_callback user_function; 148 148 void *context; 149 - char *hid; 149 + const char *hid; 150 150 }; 151 151 152 152 union acpi_aml_operands {
-1
include/asm-i386/io_apic.h
··· 150 150 151 151 #else /* !CONFIG_X86_IO_APIC */ 152 152 #define io_apic_assign_pci_irqs 0 153 - static inline void disable_ioapic_setup(void) { } 154 153 #endif 155 154 156 155 #endif
+6
include/asm-x86_64/io_apic.h
··· 109 109 /* 1 if "noapic" boot option passed */ 110 110 extern int skip_ioapic_setup; 111 111 112 + static inline void disable_ioapic_setup(void) 113 + { 114 + skip_ioapic_setup = 1; 115 + } 116 + 117 + 112 118 /* 113 119 * If we use the IO-APIC for IRQ routing, disable automatic 114 120 * assignment of PCI IRQ's.
+6
include/linux/input.h
··· 363 363 364 364 #define KEY_UNKNOWN 240 365 365 366 + #define KEY_VIDEO_NEXT 241 /* drive next video source */ 367 + #define KEY_VIDEO_PREV 242 /* drive previous video source */ 368 + #define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ 369 + #define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ 370 + #define KEY_DISPLAY_OFF 245 /* display device to off state */ 371 + 366 372 #define BTN_MISC 0x100 367 373 #define BTN_0 0x100 368 374 #define BTN_1 0x101
+10 -2
init/main.c
··· 146 146 * greater than 0, limits the maximum number of CPUs activated in 147 147 * SMP mode to <NUM>. 148 148 */ 149 + #ifndef CONFIG_X86_IO_APIC 150 + static inline void disable_ioapic_setup(void) {}; 151 + #endif 152 + 149 153 static int __init nosmp(char *str) 150 154 { 151 155 max_cpus = 0; 156 + disable_ioapic_setup(); 152 157 return 0; 153 158 } 154 159 ··· 162 157 static int __init maxcpus(char *str) 163 158 { 164 159 get_option(&str, &max_cpus); 165 - return 1; 160 + if (max_cpus == 0) 161 + disable_ioapic_setup(); 162 + 163 + return 0; 166 164 } 167 165 168 - __setup("maxcpus=", maxcpus); 166 + early_param("maxcpus=", maxcpus); 169 167 #else 170 168 #define max_cpus NR_CPUS 171 169 #endif