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