aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/laptops/asus-laptop.txt8
-rw-r--r--Documentation/laptops/sony-laptop.txt8
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt73
-rw-r--r--arch/x86/mm/srat.c11
-rw-r--r--drivers/acpi/Kconfig18
-rw-r--r--drivers/acpi/ac.c1
-rw-r--r--drivers/acpi/acpi_pad.c1
-rw-r--r--drivers/acpi/acpi_platform.c24
-rw-r--r--drivers/acpi/battery.c2
-rw-r--r--drivers/acpi/bus.c120
-rw-r--r--drivers/acpi/button.c2
-rw-r--r--drivers/acpi/dock.c2
-rw-r--r--drivers/acpi/ec.c2
-rw-r--r--drivers/acpi/event.c106
-rw-r--r--drivers/acpi/internal.h1
-rw-r--r--drivers/acpi/numa.c2
-rw-r--r--drivers/acpi/osl.c41
-rw-r--r--drivers/acpi/processor_core.c2
-rw-r--r--drivers/acpi/processor_driver.c4
-rw-r--r--drivers/acpi/sbs.c15
-rw-r--r--drivers/acpi/scan.c30
-rw-r--r--drivers/acpi/sleep.c2
-rw-r--r--drivers/acpi/thermal.c19
-rw-r--r--drivers/acpi/video.c10
-rw-r--r--drivers/char/sonypi.c5
-rw-r--r--drivers/pci/hotplug/acpiphp_ibm.c1
-rw-r--r--drivers/platform/x86/asus-laptop.c1
-rw-r--r--drivers/platform/x86/eeepc-laptop.c1
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c4
-rw-r--r--drivers/platform/x86/panasonic-laptop.c3
-rw-r--r--drivers/platform/x86/sony-laptop.c4
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c40
-rw-r--r--include/acpi/acpi_bus.h10
-rw-r--r--lib/earlycpio.c27
34 files changed, 105 insertions, 495 deletions
diff --git a/Documentation/laptops/asus-laptop.txt b/Documentation/laptops/asus-laptop.txt
index 69f9fb3701e0..79a1bc675a8d 100644
--- a/Documentation/laptops/asus-laptop.txt
+++ b/Documentation/laptops/asus-laptop.txt
@@ -8,8 +8,8 @@ http://acpi4asus.sf.net/
8 8
9 This driver provides support for extra features of ACPI-compatible ASUS laptops. 9 This driver provides support for extra features of ACPI-compatible ASUS laptops.
10 It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or 10 It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or
11 VICTOR XP7210 for example). It makes all the extra buttons generate standard 11 VICTOR XP7210 for example). It makes all the extra buttons generate input
12 ACPI events that go through /proc/acpi/events and input events (like keyboards). 12 events (like keyboards).
13 On some models adds support for changing the display brightness and output, 13 On some models adds support for changing the display brightness and output,
14 switching the LCD backlight on and off, and most importantly, allows you to 14 switching the LCD backlight on and off, and most importantly, allows you to
15 blink those fancy LEDs intended for reporting mail and wireless status. 15 blink those fancy LEDs intended for reporting mail and wireless status.
@@ -55,8 +55,8 @@ Usage
55 DSDT) to me. 55 DSDT) to me.
56 56
57 That's all, now, all the events generated by the hotkeys of your laptop 57 That's all, now, all the events generated by the hotkeys of your laptop
58 should be reported in your /proc/acpi/event entry. You can check with 58 should be reported via netlink events. You can check with
59 "acpi_listen". 59 "acpi_genl monitor" (part of the acpica project).
60 60
61 Hotkeys are also reported as input keys (like keyboards) you can check 61 Hotkeys are also reported as input keys (like keyboards) you can check
62 which key are supported using "xev" under X11. 62 which key are supported using "xev" under X11.
diff --git a/Documentation/laptops/sony-laptop.txt b/Documentation/laptops/sony-laptop.txt
index 0d5ac7f5287e..978b1e615155 100644
--- a/Documentation/laptops/sony-laptop.txt
+++ b/Documentation/laptops/sony-laptop.txt
@@ -12,10 +12,10 @@ Fn keys (hotkeys):
12------------------ 12------------------
13Some models report hotkeys through the SNC or SPIC devices, such events are 13Some models report hotkeys through the SNC or SPIC devices, such events are
14reported both through the ACPI subsystem as acpi events and through the INPUT 14reported both through the ACPI subsystem as acpi events and through the INPUT
15subsystem. See the logs of acpid or /proc/acpi/event and 15subsystem. See the logs of /proc/bus/input/devices to find out what those
16/proc/bus/input/devices to find out what those events are and which input 16events are and which input devices are created by the driver.
17devices are created by the driver. Additionally, loading the driver with the 17Additionally, loading the driver with the debug option will report all events
18debug option will report all events in the kernel log. 18in the kernel log.
19 19
20The "scancodes" passed to the input system (that can be remapped with udev) 20The "scancodes" passed to the input system (that can be remapped with udev)
21are indexes to the table "sony_laptop_input_keycode_map" in the sony-laptop.c 21are indexes to the table "sony_laptop_input_keycode_map" in the sony-laptop.c
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index cf7bc6cb9719..86c52360ffe7 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -329,20 +329,6 @@ sysfs notes:
329 329
330 This attribute has poll()/select() support. 330 This attribute has poll()/select() support.
331 331
332 hotkey_report_mode:
333 Returns the state of the procfs ACPI event report mode
334 filter for hot keys. If it is set to 1 (the default),
335 all hot key presses are reported both through the input
336 layer and also as ACPI events through procfs (but not
337 through netlink). If it is set to 2, hot key presses
338 are reported only through the input layer.
339
340 This attribute is read-only in kernels 2.6.23 or later,
341 and read-write on earlier kernels.
342
343 May return -EPERM (write access locked out by module
344 parameter) or -EACCES (read-only).
345
346 wakeup_reason: 332 wakeup_reason:
347 Set to 1 if the system is waking up because the user 333 Set to 1 if the system is waking up because the user
348 requested a bay ejection. Set to 2 if the system is 334 requested a bay ejection. Set to 2 if the system is
@@ -518,24 +504,21 @@ SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A
518Non hotkey ACPI HKEY event map: 504Non hotkey ACPI HKEY event map:
519------------------------------- 505-------------------------------
520 506
521Events that are not propagated by the driver, except for legacy
522compatibility purposes when hotkey_report_mode is set to 1:
523
5240x5001 Lid closed
5250x5002 Lid opened
5260x5009 Tablet swivel: switched to tablet mode
5270x500A Tablet swivel: switched to normal mode
5280x7000 Radio Switch may have changed state
529
530Events that are never propagated by the driver: 507Events that are never propagated by the driver:
531 508
5320x2304 System is waking up from suspend to undock 5090x2304 System is waking up from suspend to undock
5330x2305 System is waking up from suspend to eject bay 5100x2305 System is waking up from suspend to eject bay
5340x2404 System is waking up from hibernation to undock 5110x2404 System is waking up from hibernation to undock
5350x2405 System is waking up from hibernation to eject bay 5120x2405 System is waking up from hibernation to eject bay
5130x5001 Lid closed
5140x5002 Lid opened
5150x5009 Tablet swivel: switched to tablet mode
5160x500A Tablet swivel: switched to normal mode
5360x5010 Brightness level changed/control event 5170x5010 Brightness level changed/control event
5370x6000 KEYBOARD: Numlock key pressed 5180x6000 KEYBOARD: Numlock key pressed
5380x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED) 5190x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED)
5200x7000 Radio Switch may have changed state
521
539 522
540Events that are propagated by the driver to userspace: 523Events that are propagated by the driver to userspace:
541 524
@@ -574,50 +557,6 @@ operating system is to force either an immediate suspend or hibernate
574cycle, or a system shutdown. Obviously, something is very wrong if this 557cycle, or a system shutdown. Obviously, something is very wrong if this
575happens. 558happens.
576 559
577Compatibility notes:
578
579ibm-acpi and thinkpad-acpi 0.15 (mainline kernels before 2.6.23) never
580supported the input layer, and sent events over the procfs ACPI event
581interface.
582
583To avoid sending duplicate events over the input layer and the ACPI
584event interface, thinkpad-acpi 0.16 implements a module parameter
585(hotkey_report_mode), and also a sysfs device attribute with the same
586name.
587
588Make no mistake here: userspace is expected to switch to using the input
589layer interface of thinkpad-acpi, together with the ACPI netlink event
590interface in kernels 2.6.23 and later, or with the ACPI procfs event
591interface in kernels 2.6.22 and earlier.
592
593If no hotkey_report_mode module parameter is specified (or it is set to
594zero), the driver defaults to mode 1 (see below), and on kernels 2.6.22
595and earlier, also allows one to change the hotkey_report_mode through
596sysfs. In kernels 2.6.23 and later, where the netlink ACPI event
597interface is available, hotkey_report_mode cannot be changed through
598sysfs (it is read-only).
599
600If the hotkey_report_mode module parameter is set to 1 or 2, it cannot
601be changed later through sysfs (any writes will return -EPERM to signal
602that hotkey_report_mode was locked. On 2.6.23 and later, where
603hotkey_report_mode cannot be changed at all, writes will return -EACCES).
604
605hotkey_report_mode set to 1 makes the driver export through the procfs
606ACPI event interface all hot key presses (which are *also* sent to the
607input layer). This is a legacy compatibility behaviour, and it is also
608the default mode of operation for the driver.
609
610hotkey_report_mode set to 2 makes the driver filter out the hot key
611presses from the procfs ACPI event interface, so these events will only
612be sent through the input layer. Userspace that has been updated to use
613the thinkpad-acpi input layer interface should set hotkey_report_mode to
6142.
615
616Hot key press events are never sent to the ACPI netlink event interface.
617Really up-to-date userspace under kernel 2.6.23 and later is to use the
618netlink interface and the input layer interface, and don't bother at all
619with hotkey_report_mode.
620
621 560
622Brightness hotkey notes: 561Brightness hotkey notes:
623 562
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c
index cdd0da9dd530..266ca912f62e 100644
--- a/arch/x86/mm/srat.c
+++ b/arch/x86/mm/srat.c
@@ -146,6 +146,7 @@ int __init
146acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) 146acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
147{ 147{
148 u64 start, end; 148 u64 start, end;
149 u32 hotpluggable;
149 int node, pxm; 150 int node, pxm;
150 151
151 if (srat_disabled()) 152 if (srat_disabled())
@@ -154,7 +155,8 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
154 goto out_err_bad_srat; 155 goto out_err_bad_srat;
155 if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0) 156 if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
156 goto out_err; 157 goto out_err;
157 if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info()) 158 hotpluggable = ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE;
159 if (hotpluggable && !save_add_info())
158 goto out_err; 160 goto out_err;
159 161
160 start = ma->base_address; 162 start = ma->base_address;
@@ -174,9 +176,10 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
174 176
175 node_set(node, numa_nodes_parsed); 177 node_set(node, numa_nodes_parsed);
176 178
177 printk(KERN_INFO "SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n", 179 pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s\n",
178 node, pxm, 180 node, pxm,
179 (unsigned long long) start, (unsigned long long) end - 1); 181 (unsigned long long) start, (unsigned long long) end - 1,
182 hotpluggable ? " hotplug" : "");
180 183
181 return 0; 184 return 0;
182out_err_bad_srat: 185out_err_bad_srat:
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 100bd724f648..3278a210c435 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -91,24 +91,6 @@ config ACPI_EC_DEBUGFS
91 Thus this option is a debug option that helps to write ACPI drivers 91 Thus this option is a debug option that helps to write ACPI drivers
92 and can be used to identify ACPI code or EC firmware bugs. 92 and can be used to identify ACPI code or EC firmware bugs.
93 93
94config ACPI_PROC_EVENT
95 bool "Deprecated /proc/acpi/event support"
96 depends on PROC_FS
97 default y
98 help
99 A user-space daemon, acpid, typically reads /proc/acpi/event
100 and handles all ACPI-generated events.
101
102 These events are now delivered to user-space either
103 via the input layer or as netlink events.
104
105 This build option enables the old code for legacy
106 user-space implementation. After some time, this will
107 be moved under CONFIG_ACPI_PROCFS, and then deleted.
108
109 Say Y here to retain the old behaviour. Say N if your
110 user-space is newer than kernel 2.6.23 (September 2007).
111
112config ACPI_AC 94config ACPI_AC
113 tristate "AC Adapter" 95 tristate "AC Adapter"
114 depends on X86 96 depends on X86
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 4f4e741d34b2..f37beaa32750 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -267,7 +267,6 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event)
267 msleep(ac_sleep_before_get_state_ms); 267 msleep(ac_sleep_before_get_state_ms);
268 268
269 acpi_ac_get_state(ac); 269 acpi_ac_get_state(ac);
270 acpi_bus_generate_proc_event(device, event, (u32) ac->state);
271 acpi_bus_generate_netlink_event(device->pnp.device_class, 270 acpi_bus_generate_netlink_event(device->pnp.device_class,
272 dev_name(&device->dev), event, 271 dev_name(&device->dev), event,
273 (u32) ac->state); 272 (u32) ac->state);
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index 27bb6a91de5f..6230637054c6 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -452,7 +452,6 @@ static void acpi_pad_notify(acpi_handle handle, u32 event,
452 switch (event) { 452 switch (event) {
453 case ACPI_PROCESSOR_AGGREGATOR_NOTIFY: 453 case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
454 acpi_pad_handle_notify(handle); 454 acpi_pad_handle_notify(handle);
455 acpi_bus_generate_proc_event(device, event, 0);
456 acpi_bus_generate_netlink_event(device->pnp.device_class, 455 acpi_bus_generate_netlink_event(device->pnp.device_class,
457 dev_name(&device->dev), event, 0); 456 dev_name(&device->dev), event, 0);
458 break; 457 break;
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index fafec5ddf17f..1bde12708f9e 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -52,7 +52,7 @@ int acpi_create_platform_device(struct acpi_device *adev,
52 struct platform_device_info pdevinfo; 52 struct platform_device_info pdevinfo;
53 struct resource_list_entry *rentry; 53 struct resource_list_entry *rentry;
54 struct list_head resource_list; 54 struct list_head resource_list;
55 struct resource *resources; 55 struct resource *resources = NULL;
56 int count; 56 int count;
57 57
58 /* If the ACPI node already has a physical device attached, skip it. */ 58 /* If the ACPI node already has a physical device attached, skip it. */
@@ -61,20 +61,22 @@ int acpi_create_platform_device(struct acpi_device *adev,
61 61
62 INIT_LIST_HEAD(&resource_list); 62 INIT_LIST_HEAD(&resource_list);
63 count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL); 63 count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
64 if (count <= 0) 64 if (count < 0) {
65 return 0; 65 return 0;
66 } else if (count > 0) {
67 resources = kmalloc(count * sizeof(struct resource),
68 GFP_KERNEL);
69 if (!resources) {
70 dev_err(&adev->dev, "No memory for resources\n");
71 acpi_dev_free_resource_list(&resource_list);
72 return -ENOMEM;
73 }
74 count = 0;
75 list_for_each_entry(rentry, &resource_list, node)
76 resources[count++] = rentry->res;
66 77
67 resources = kmalloc(count * sizeof(struct resource), GFP_KERNEL);
68 if (!resources) {
69 dev_err(&adev->dev, "No memory for resources\n");
70 acpi_dev_free_resource_list(&resource_list); 78 acpi_dev_free_resource_list(&resource_list);
71 return -ENOMEM;
72 } 79 }
73 count = 0;
74 list_for_each_entry(rentry, &resource_list, node)
75 resources[count++] = rentry->res;
76
77 acpi_dev_free_resource_list(&resource_list);
78 80
79 memset(&pdevinfo, 0, sizeof(pdevinfo)); 81 memset(&pdevinfo, 0, sizeof(pdevinfo));
80 /* 82 /*
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index da9fcaac1e85..2c9958cd7a43 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -1028,8 +1028,6 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
1028 if (event == ACPI_BATTERY_NOTIFY_INFO) 1028 if (event == ACPI_BATTERY_NOTIFY_INFO)
1029 acpi_battery_refresh(battery); 1029 acpi_battery_refresh(battery);
1030 acpi_battery_update(battery); 1030 acpi_battery_update(battery);
1031 acpi_bus_generate_proc_event(device, event,
1032 acpi_battery_present(battery));
1033 acpi_bus_generate_netlink_event(device->pnp.device_class, 1031 acpi_bus_generate_netlink_event(device->pnp.device_class,
1034 dev_name(&device->dev), event, 1032 dev_name(&device->dev), event,
1035 acpi_battery_present(battery)); 1033 acpi_battery_present(battery));
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 6fd27a9abcda..b587ec8257b2 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -89,27 +89,6 @@ static struct dmi_system_id dsdt_dmi_table[] __initdata = {
89 Device Management 89 Device Management
90 -------------------------------------------------------------------------- */ 90 -------------------------------------------------------------------------- */
91 91
92int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
93{
94 acpi_status status;
95
96 if (!device)
97 return -EINVAL;
98
99 /* TBD: Support fixed-feature devices */
100
101 status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
102 if (ACPI_FAILURE(status) || !*device) {
103 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
104 handle));
105 return -ENODEV;
106 }
107
108 return 0;
109}
110
111EXPORT_SYMBOL(acpi_bus_get_device);
112
113acpi_status acpi_bus_get_status_handle(acpi_handle handle, 92acpi_status acpi_bus_get_status_handle(acpi_handle handle,
114 unsigned long long *sta) 93 unsigned long long *sta)
115{ 94{
@@ -346,104 +325,6 @@ static void acpi_bus_osc_support(void)
346} 325}
347 326
348/* -------------------------------------------------------------------------- 327/* --------------------------------------------------------------------------
349 Event Management
350 -------------------------------------------------------------------------- */
351
352#ifdef CONFIG_ACPI_PROC_EVENT
353static DEFINE_SPINLOCK(acpi_bus_event_lock);
354
355LIST_HEAD(acpi_bus_event_list);
356DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
357
358extern int event_is_open;
359
360int acpi_bus_generate_proc_event4(const char *device_class, const char *bus_id, u8 type, int data)
361{
362 struct acpi_bus_event *event;
363 unsigned long flags;
364
365 /* drop event on the floor if no one's listening */
366 if (!event_is_open)
367 return 0;
368
369 event = kzalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
370 if (!event)
371 return -ENOMEM;
372
373 strcpy(event->device_class, device_class);
374 strcpy(event->bus_id, bus_id);
375 event->type = type;
376 event->data = data;
377
378 spin_lock_irqsave(&acpi_bus_event_lock, flags);
379 list_add_tail(&event->node, &acpi_bus_event_list);
380 spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
381
382 wake_up_interruptible(&acpi_bus_event_queue);
383
384 return 0;
385
386}
387
388EXPORT_SYMBOL_GPL(acpi_bus_generate_proc_event4);
389
390int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
391{
392 if (!device)
393 return -EINVAL;
394 return acpi_bus_generate_proc_event4(device->pnp.device_class,
395 device->pnp.bus_id, type, data);
396}
397
398EXPORT_SYMBOL(acpi_bus_generate_proc_event);
399
400int acpi_bus_receive_event(struct acpi_bus_event *event)
401{
402 unsigned long flags;
403 struct acpi_bus_event *entry = NULL;
404
405 DECLARE_WAITQUEUE(wait, current);
406
407
408 if (!event)
409 return -EINVAL;
410
411 if (list_empty(&acpi_bus_event_list)) {
412
413 set_current_state(TASK_INTERRUPTIBLE);
414 add_wait_queue(&acpi_bus_event_queue, &wait);
415
416 if (list_empty(&acpi_bus_event_list))
417 schedule();
418
419 remove_wait_queue(&acpi_bus_event_queue, &wait);
420 set_current_state(TASK_RUNNING);
421
422 if (signal_pending(current))
423 return -ERESTARTSYS;
424 }
425
426 spin_lock_irqsave(&acpi_bus_event_lock, flags);
427 if (!list_empty(&acpi_bus_event_list)) {
428 entry = list_entry(acpi_bus_event_list.next,
429 struct acpi_bus_event, node);
430 list_del(&entry->node);
431 }
432 spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
433
434 if (!entry)
435 return -ENODEV;
436
437 memcpy(event, entry, sizeof(struct acpi_bus_event));
438
439 kfree(entry);
440
441 return 0;
442}
443
444#endif /* CONFIG_ACPI_PROC_EVENT */
445
446/* --------------------------------------------------------------------------
447 Notification Handling 328 Notification Handling
448 -------------------------------------------------------------------------- */ 329 -------------------------------------------------------------------------- */
449 330
@@ -695,7 +576,6 @@ static int __init acpi_bus_init(void)
695{ 576{
696 int result; 577 int result;
697 acpi_status status; 578 acpi_status status;
698 extern acpi_status acpi_os_initialize1(void);
699 579
700 acpi_os_initialize1(); 580 acpi_os_initialize1();
701 581
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index d2e617b5b3f6..a55773801c5f 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -303,8 +303,6 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
303 303
304 pm_wakeup_event(&device->dev, 0); 304 pm_wakeup_event(&device->dev, 0);
305 } 305 }
306
307 acpi_bus_generate_proc_event(device, event, ++button->pushed);
308 break; 306 break;
309 default: 307 default:
310 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 308 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index b527c1bd8bb2..05ea4be01a83 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -908,7 +908,7 @@ err_unregister:
908 * 908 *
909 * This is called by acpi_walk_namespace to look for dock stations and bays. 909 * This is called by acpi_walk_namespace to look for dock stations and bays.
910 */ 910 */
911static __init acpi_status 911static acpi_status __init
912find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv) 912find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
913{ 913{
914 if (acpi_dock_match(handle) || is_ejectable_bay(handle)) 914 if (acpi_dock_match(handle) || is_ejectable_bay(handle))
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 84bf06cec1f2..8dd2d4dce7c3 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -948,7 +948,7 @@ static int ec_enlarge_storm_threshold(const struct dmi_system_id *id)
948 return 0; 948 return 0;
949} 949}
950 950
951static struct dmi_system_id __initdata ec_dmi_table[] = { 951static struct dmi_system_id ec_dmi_table[] __initdata = {
952 { 952 {
953 ec_skip_dsdt_scan, "Compal JFL92", { 953 ec_skip_dsdt_scan, "Compal JFL92", {
954 DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"), 954 DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 1442737cedec..8247fcdde079 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -21,100 +21,6 @@
21#define _COMPONENT ACPI_SYSTEM_COMPONENT 21#define _COMPONENT ACPI_SYSTEM_COMPONENT
22ACPI_MODULE_NAME("event"); 22ACPI_MODULE_NAME("event");
23 23
24#ifdef CONFIG_ACPI_PROC_EVENT
25/* Global vars for handling event proc entry */
26static DEFINE_SPINLOCK(acpi_system_event_lock);
27int event_is_open = 0;
28extern struct list_head acpi_bus_event_list;
29extern wait_queue_head_t acpi_bus_event_queue;
30
31static int acpi_system_open_event(struct inode *inode, struct file *file)
32{
33 spin_lock_irq(&acpi_system_event_lock);
34
35 if (event_is_open)
36 goto out_busy;
37
38 event_is_open = 1;
39
40 spin_unlock_irq(&acpi_system_event_lock);
41 return 0;
42
43 out_busy:
44 spin_unlock_irq(&acpi_system_event_lock);
45 return -EBUSY;
46}
47
48static ssize_t
49acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
50 loff_t * ppos)
51{
52 int result = 0;
53 struct acpi_bus_event event;
54 static char str[ACPI_MAX_STRING];
55 static int chars_remaining = 0;
56 static char *ptr;
57
58 if (!chars_remaining) {
59 memset(&event, 0, sizeof(struct acpi_bus_event));
60
61 if ((file->f_flags & O_NONBLOCK)
62 && (list_empty(&acpi_bus_event_list)))
63 return -EAGAIN;
64
65 result = acpi_bus_receive_event(&event);
66 if (result)
67 return result;
68
69 chars_remaining = sprintf(str, "%s %s %08x %08x\n",
70 event.device_class ? event.
71 device_class : "<unknown>",
72 event.bus_id ? event.
73 bus_id : "<unknown>", event.type,
74 event.data);
75 ptr = str;
76 }
77
78 if (chars_remaining < count) {
79 count = chars_remaining;
80 }
81
82 if (copy_to_user(buffer, ptr, count))
83 return -EFAULT;
84
85 *ppos += count;
86 chars_remaining -= count;
87 ptr += count;
88
89 return count;
90}
91
92static int acpi_system_close_event(struct inode *inode, struct file *file)
93{
94 spin_lock_irq(&acpi_system_event_lock);
95 event_is_open = 0;
96 spin_unlock_irq(&acpi_system_event_lock);
97 return 0;
98}
99
100static unsigned int acpi_system_poll_event(struct file *file, poll_table * wait)
101{
102 poll_wait(file, &acpi_bus_event_queue, wait);
103 if (!list_empty(&acpi_bus_event_list))
104 return POLLIN | POLLRDNORM;
105 return 0;
106}
107
108static const struct file_operations acpi_system_event_ops = {
109 .owner = THIS_MODULE,
110 .open = acpi_system_open_event,
111 .read = acpi_system_read_event,
112 .release = acpi_system_close_event,
113 .poll = acpi_system_poll_event,
114 .llseek = default_llseek,
115};
116#endif /* CONFIG_ACPI_PROC_EVENT */
117
118/* ACPI notifier chain */ 24/* ACPI notifier chain */
119static BLOCKING_NOTIFIER_HEAD(acpi_chain_head); 25static BLOCKING_NOTIFIER_HEAD(acpi_chain_head);
120 26
@@ -280,9 +186,6 @@ static int acpi_event_genetlink_init(void)
280 186
281static int __init acpi_event_init(void) 187static int __init acpi_event_init(void)
282{ 188{
283#ifdef CONFIG_ACPI_PROC_EVENT
284 struct proc_dir_entry *entry;
285#endif
286 int error = 0; 189 int error = 0;
287 190
288 if (acpi_disabled) 191 if (acpi_disabled)
@@ -293,15 +196,6 @@ static int __init acpi_event_init(void)
293 if (error) 196 if (error)
294 printk(KERN_WARNING PREFIX 197 printk(KERN_WARNING PREFIX
295 "Failed to create genetlink family for ACPI event\n"); 198 "Failed to create genetlink family for ACPI event\n");
296
297#ifdef CONFIG_ACPI_PROC_EVENT
298 /* 'event' [R] */
299 entry = proc_create("event", S_IRUSR, acpi_root_dir,
300 &acpi_system_event_ops);
301 if (!entry)
302 return -ENODEV;
303#endif
304
305 return 0; 199 return 0;
306} 200}
307 201
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 5da44e81dd4d..20f423337e1f 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -23,6 +23,7 @@
23 23
24#define PREFIX "ACPI: " 24#define PREFIX "ACPI: "
25 25
26acpi_status acpi_os_initialize1(void);
26int init_acpi_device_notify(void); 27int init_acpi_device_notify(void);
27int acpi_scan_init(void); 28int acpi_scan_init(void);
28#ifdef CONFIG_ACPI_PCI_SLOT 29#ifdef CONFIG_ACPI_PCI_SLOT
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 33e609f63585..2e82e5d76930 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -159,7 +159,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
159 * distance than the others. 159 * distance than the others.
160 * Do some quick checks here and only use the SLIT if it passes. 160 * Do some quick checks here and only use the SLIT if it passes.
161 */ 161 */
162static __init int slit_valid(struct acpi_table_slit *slit) 162static int __init slit_valid(struct acpi_table_slit *slit)
163{ 163{
164 int i, j; 164 int i, j;
165 int d = slit->locality_count; 165 int d = slit->locality_count;
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 2bba9669546a..e5f416c7f66e 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -52,6 +52,7 @@
52#include <acpi/acpi.h> 52#include <acpi/acpi.h>
53#include <acpi/acpi_bus.h> 53#include <acpi/acpi_bus.h>
54#include <acpi/processor.h> 54#include <acpi/processor.h>
55#include "internal.h"
55 56
56#define _COMPONENT ACPI_OS_SERVICES 57#define _COMPONENT ACPI_OS_SERVICES
57ACPI_MODULE_NAME("osl"); 58ACPI_MODULE_NAME("osl");
@@ -566,10 +567,6 @@ static const char * const table_sigs[] = {
566 ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT, 567 ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT,
567 ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, NULL }; 568 ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, NULL };
568 569
569/* Non-fatal errors: Affected tables/files are ignored */
570#define INVALID_TABLE(x, path, name) \
571 { pr_err("ACPI OVERRIDE: " x " [%s%s]\n", path, name); continue; }
572
573#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header) 570#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)
574 571
575/* Must not increase 10 or needs code modification below */ 572/* Must not increase 10 or needs code modification below */
@@ -596,9 +593,11 @@ void __init acpi_initrd_override(void *data, size_t size)
596 data += offset; 593 data += offset;
597 size -= offset; 594 size -= offset;
598 595
599 if (file.size < sizeof(struct acpi_table_header)) 596 if (file.size < sizeof(struct acpi_table_header)) {
600 INVALID_TABLE("Table smaller than ACPI header", 597 pr_err("ACPI OVERRIDE: Table smaller than ACPI header [%s%s]\n",
601 cpio_path, file.name); 598 cpio_path, file.name);
599 continue;
600 }
602 601
603 table = file.data; 602 table = file.data;
604 603
@@ -606,15 +605,21 @@ void __init acpi_initrd_override(void *data, size_t size)
606 if (!memcmp(table->signature, table_sigs[sig], 4)) 605 if (!memcmp(table->signature, table_sigs[sig], 4))
607 break; 606 break;
608 607
609 if (!table_sigs[sig]) 608 if (!table_sigs[sig]) {
610 INVALID_TABLE("Unknown signature", 609 pr_err("ACPI OVERRIDE: Unknown signature [%s%s]\n",
611 cpio_path, file.name); 610 cpio_path, file.name);
612 if (file.size != table->length) 611 continue;
613 INVALID_TABLE("File length does not match table length", 612 }
614 cpio_path, file.name); 613 if (file.size != table->length) {
615 if (acpi_table_checksum(file.data, table->length)) 614 pr_err("ACPI OVERRIDE: File length does not match table length [%s%s]\n",
616 INVALID_TABLE("Bad table checksum", 615 cpio_path, file.name);
617 cpio_path, file.name); 616 continue;
617 }
618 if (acpi_table_checksum(file.data, table->length)) {
619 pr_err("ACPI OVERRIDE: Bad table checksum [%s%s]\n",
620 cpio_path, file.name);
621 continue;
622 }
618 623
619 pr_info("%4.4s ACPI table found in initrd [%s%s][0x%x]\n", 624 pr_info("%4.4s ACPI table found in initrd [%s%s][0x%x]\n",
620 table->signature, cpio_path, file.name, table->length); 625 table->signature, cpio_path, file.name, table->length);
@@ -1354,8 +1359,8 @@ struct osi_setup_entry {
1354 bool enable; 1359 bool enable;
1355}; 1360};
1356 1361
1357static struct osi_setup_entry __initdata 1362static struct osi_setup_entry
1358 osi_setup_entries[OSI_STRING_ENTRIES_MAX] = { 1363 osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = {
1359 {"Module Device", true}, 1364 {"Module Device", true},
1360 {"Processor Device", true}, 1365 {"Processor Device", true},
1361 {"3.0 _SCP Extensions", true}, 1366 {"3.0 _SCP Extensions", true},
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index a5e9f4a5b281..cf34d903f4fb 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -28,7 +28,7 @@ static int __init set_no_mwait(const struct dmi_system_id *id)
28 return 0; 28 return 0;
29} 29}
30 30
31static struct dmi_system_id __initdata processor_idle_dmi_table[] = { 31static struct dmi_system_id processor_idle_dmi_table[] __initdata = {
32 { 32 {
33 set_no_mwait, "Extensa 5220", { 33 set_no_mwait, "Extensa 5220", {
34 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), 34 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 870eaf5fa547..bd11ef93b0ce 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -91,21 +91,17 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
91 acpi_processor_ppc_has_changed(pr, 1); 91 acpi_processor_ppc_has_changed(pr, 1);
92 if (saved == pr->performance_platform_limit) 92 if (saved == pr->performance_platform_limit)
93 break; 93 break;
94 acpi_bus_generate_proc_event(device, event,
95 pr->performance_platform_limit);
96 acpi_bus_generate_netlink_event(device->pnp.device_class, 94 acpi_bus_generate_netlink_event(device->pnp.device_class,
97 dev_name(&device->dev), event, 95 dev_name(&device->dev), event,
98 pr->performance_platform_limit); 96 pr->performance_platform_limit);
99 break; 97 break;
100 case ACPI_PROCESSOR_NOTIFY_POWER: 98 case ACPI_PROCESSOR_NOTIFY_POWER:
101 acpi_processor_cst_has_changed(pr); 99 acpi_processor_cst_has_changed(pr);
102 acpi_bus_generate_proc_event(device, event, 0);
103 acpi_bus_generate_netlink_event(device->pnp.device_class, 100 acpi_bus_generate_netlink_event(device->pnp.device_class,
104 dev_name(&device->dev), event, 0); 101 dev_name(&device->dev), event, 0);
105 break; 102 break;
106 case ACPI_PROCESSOR_NOTIFY_THROTTLING: 103 case ACPI_PROCESSOR_NOTIFY_THROTTLING:
107 acpi_processor_tstate_has_changed(pr); 104 acpi_processor_tstate_has_changed(pr);
108 acpi_bus_generate_proc_event(device, event, 0);
109 acpi_bus_generate_netlink_event(device->pnp.device_class, 105 acpi_bus_generate_netlink_event(device->pnp.device_class,
110 dev_name(&device->dev), event, 0); 106 dev_name(&device->dev), event, 0);
111 break; 107 break;
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index b6241eeb1132..aef7e1cd1e5d 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -873,14 +873,9 @@ static void acpi_sbs_callback(void *context)
873 u8 saved_charger_state = sbs->charger_present; 873 u8 saved_charger_state = sbs->charger_present;
874 u8 saved_battery_state; 874 u8 saved_battery_state;
875 acpi_ac_get_present(sbs); 875 acpi_ac_get_present(sbs);
876 if (sbs->charger_present != saved_charger_state) { 876 if (sbs->charger_present != saved_charger_state)
877#ifdef CONFIG_ACPI_PROC_EVENT
878 acpi_bus_generate_proc_event4(ACPI_AC_CLASS, ACPI_AC_DIR_NAME,
879 ACPI_SBS_NOTIFY_STATUS,
880 sbs->charger_present);
881#endif
882 kobject_uevent(&sbs->charger.dev->kobj, KOBJ_CHANGE); 877 kobject_uevent(&sbs->charger.dev->kobj, KOBJ_CHANGE);
883 } 878
884 if (sbs->manager_present) { 879 if (sbs->manager_present) {
885 for (id = 0; id < MAX_SBS_BAT; ++id) { 880 for (id = 0; id < MAX_SBS_BAT; ++id) {
886 if (!(sbs->batteries_supported & (1 << id))) 881 if (!(sbs->batteries_supported & (1 << id)))
@@ -890,12 +885,6 @@ static void acpi_sbs_callback(void *context)
890 acpi_battery_read(bat); 885 acpi_battery_read(bat);
891 if (saved_battery_state == bat->present) 886 if (saved_battery_state == bat->present)
892 continue; 887 continue;
893#ifdef CONFIG_ACPI_PROC_EVENT
894 acpi_bus_generate_proc_event4(ACPI_BATTERY_CLASS,
895 bat->name,
896 ACPI_SBS_NOTIFY_STATUS,
897 bat->present);
898#endif
899 kobject_uevent(&bat->bat.dev->kobj, KOBJ_CHANGE); 888 kobject_uevent(&bat->bat.dev->kobj, KOBJ_CHANGE);
900 } 889 }
901 } 890 }
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a8a55d4143f2..e76365136ba3 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -970,6 +970,28 @@ struct bus_type acpi_bus_type = {
970 .uevent = acpi_device_uevent, 970 .uevent = acpi_device_uevent,
971}; 971};
972 972
973static void acpi_bus_data_handler(acpi_handle handle, void *context)
974{
975 /* Intentionally empty. */
976}
977
978int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
979{
980 acpi_status status;
981
982 if (!device)
983 return -EINVAL;
984
985 status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
986 if (ACPI_FAILURE(status) || !*device) {
987 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
988 handle));
989 return -ENODEV;
990 }
991 return 0;
992}
993EXPORT_SYMBOL_GPL(acpi_bus_get_device);
994
973int acpi_device_add(struct acpi_device *device, 995int acpi_device_add(struct acpi_device *device,
974 void (*release)(struct device *)) 996 void (*release)(struct device *))
975{ 997{
@@ -1181,14 +1203,6 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
1181} 1203}
1182EXPORT_SYMBOL_GPL(acpi_bus_get_ejd); 1204EXPORT_SYMBOL_GPL(acpi_bus_get_ejd);
1183 1205
1184void acpi_bus_data_handler(acpi_handle handle, void *context)
1185{
1186
1187 /* TBD */
1188
1189 return;
1190}
1191
1192static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle, 1206static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
1193 struct acpi_device_wakeup *wakeup) 1207 struct acpi_device_wakeup *wakeup)
1194{ 1208{
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 1dec53decffa..14df30580e15 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -138,7 +138,7 @@ static int __init init_nvs_nosave(const struct dmi_system_id *d)
138 return 0; 138 return 0;
139} 139}
140 140
141static struct dmi_system_id __initdata acpisleep_dmi_table[] = { 141static struct dmi_system_id acpisleep_dmi_table[] __initdata = {
142 { 142 {
143 .callback = init_old_suspend_ordering, 143 .callback = init_old_suspend_ordering,
144 .ident = "Abit KN9 (nForce4 variant)", 144 .ident = "Abit KN9 (nForce4 variant)",
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 94523c79dc5f..9063239e0b13 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -50,11 +50,6 @@
50 50
51#define ACPI_THERMAL_CLASS "thermal_zone" 51#define ACPI_THERMAL_CLASS "thermal_zone"
52#define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" 52#define ACPI_THERMAL_DEVICE_NAME "Thermal Zone"
53#define ACPI_THERMAL_FILE_STATE "state"
54#define ACPI_THERMAL_FILE_TEMPERATURE "temperature"
55#define ACPI_THERMAL_FILE_TRIP_POINTS "trip_points"
56#define ACPI_THERMAL_FILE_COOLING_MODE "cooling_mode"
57#define ACPI_THERMAL_FILE_POLLING_FREQ "polling_frequency"
58#define ACPI_THERMAL_NOTIFY_TEMPERATURE 0x80 53#define ACPI_THERMAL_NOTIFY_TEMPERATURE 0x80
59#define ACPI_THERMAL_NOTIFY_THRESHOLDS 0x81 54#define ACPI_THERMAL_NOTIFY_THRESHOLDS 0x81
60#define ACPI_THERMAL_NOTIFY_DEVICES 0x82 55#define ACPI_THERMAL_NOTIFY_DEVICES 0x82
@@ -190,7 +185,6 @@ struct acpi_thermal {
190 struct thermal_zone_device *thermal_zone; 185 struct thermal_zone_device *thermal_zone;
191 int tz_enabled; 186 int tz_enabled;
192 int kelvin_offset; 187 int kelvin_offset;
193 struct mutex lock;
194}; 188};
195 189
196/* -------------------------------------------------------------------------- 190/* --------------------------------------------------------------------------
@@ -759,7 +753,6 @@ static int thermal_notify(struct thermal_zone_device *thermal, int trip,
759 else 753 else
760 return 0; 754 return 0;
761 755
762 acpi_bus_generate_proc_event(tz->device, type, 1);
763 acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 756 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
764 dev_name(&tz->device->dev), type, 1); 757 dev_name(&tz->device->dev), type, 1);
765 758
@@ -840,12 +833,13 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
840 if (ACPI_SUCCESS(status) && (dev == device)) { 833 if (ACPI_SUCCESS(status) && (dev == device)) {
841 if (bind) 834 if (bind)
842 result = thermal_zone_bind_cooling_device 835 result = thermal_zone_bind_cooling_device
843 (thermal, -1, cdev, 836 (thermal, THERMAL_TRIPS_NONE,
844 THERMAL_NO_LIMIT, 837 cdev, THERMAL_NO_LIMIT,
845 THERMAL_NO_LIMIT); 838 THERMAL_NO_LIMIT);
846 else 839 else
847 result = thermal_zone_unbind_cooling_device 840 result = thermal_zone_unbind_cooling_device
848 (thermal, -1, cdev); 841 (thermal, THERMAL_TRIPS_NONE,
842 cdev);
849 if (result) 843 if (result)
850 goto failed; 844 goto failed;
851 } 845 }
@@ -970,14 +964,12 @@ static void acpi_thermal_notify(struct acpi_device *device, u32 event)
970 case ACPI_THERMAL_NOTIFY_THRESHOLDS: 964 case ACPI_THERMAL_NOTIFY_THRESHOLDS:
971 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_THRESHOLDS); 965 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_THRESHOLDS);
972 acpi_thermal_check(tz); 966 acpi_thermal_check(tz);
973 acpi_bus_generate_proc_event(device, event, 0);
974 acpi_bus_generate_netlink_event(device->pnp.device_class, 967 acpi_bus_generate_netlink_event(device->pnp.device_class,
975 dev_name(&device->dev), event, 0); 968 dev_name(&device->dev), event, 0);
976 break; 969 break;
977 case ACPI_THERMAL_NOTIFY_DEVICES: 970 case ACPI_THERMAL_NOTIFY_DEVICES:
978 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES); 971 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES);
979 acpi_thermal_check(tz); 972 acpi_thermal_check(tz);
980 acpi_bus_generate_proc_event(device, event, 0);
981 acpi_bus_generate_netlink_event(device->pnp.device_class, 973 acpi_bus_generate_netlink_event(device->pnp.device_class,
982 dev_name(&device->dev), event, 0); 974 dev_name(&device->dev), event, 0);
983 break; 975 break;
@@ -1091,8 +1083,6 @@ static int acpi_thermal_add(struct acpi_device *device)
1091 strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); 1083 strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
1092 strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); 1084 strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);
1093 device->driver_data = tz; 1085 device->driver_data = tz;
1094 mutex_init(&tz->lock);
1095
1096 1086
1097 result = acpi_thermal_get_info(tz); 1087 result = acpi_thermal_get_info(tz);
1098 if (result) 1088 if (result)
@@ -1125,7 +1115,6 @@ static int acpi_thermal_remove(struct acpi_device *device)
1125 tz = acpi_driver_data(device); 1115 tz = acpi_driver_data(device);
1126 1116
1127 acpi_thermal_unregister_thermal_zone(tz); 1117 acpi_thermal_unregister_thermal_zone(tz);
1128 mutex_destroy(&tz->lock);
1129 kfree(tz); 1118 kfree(tz);
1130 return 0; 1119 return 0;
1131} 1120}
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 725143016f3b..c86fc0c70ff6 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1550,7 +1550,6 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
1550 switch (event) { 1550 switch (event) {
1551 case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch, 1551 case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch,
1552 * most likely via hotkey. */ 1552 * most likely via hotkey. */
1553 acpi_bus_generate_proc_event(device, event, 0);
1554 keycode = KEY_SWITCHVIDEOMODE; 1553 keycode = KEY_SWITCHVIDEOMODE;
1555 break; 1554 break;
1556 1555
@@ -1558,20 +1557,16 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
1558 * connector. */ 1557 * connector. */
1559 acpi_video_device_enumerate(video); 1558 acpi_video_device_enumerate(video);
1560 acpi_video_device_rebind(video); 1559 acpi_video_device_rebind(video);
1561 acpi_bus_generate_proc_event(device, event, 0);
1562 keycode = KEY_SWITCHVIDEOMODE; 1560 keycode = KEY_SWITCHVIDEOMODE;
1563 break; 1561 break;
1564 1562
1565 case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */ 1563 case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */
1566 acpi_bus_generate_proc_event(device, event, 0);
1567 keycode = KEY_SWITCHVIDEOMODE; 1564 keycode = KEY_SWITCHVIDEOMODE;
1568 break; 1565 break;
1569 case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */ 1566 case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */
1570 acpi_bus_generate_proc_event(device, event, 0);
1571 keycode = KEY_VIDEO_NEXT; 1567 keycode = KEY_VIDEO_NEXT;
1572 break; 1568 break;
1573 case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */ 1569 case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */
1574 acpi_bus_generate_proc_event(device, event, 0);
1575 keycode = KEY_VIDEO_PREV; 1570 keycode = KEY_VIDEO_PREV;
1576 break; 1571 break;
1577 1572
@@ -1614,31 +1609,26 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
1614 case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */ 1609 case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */
1615 if (brightness_switch_enabled) 1610 if (brightness_switch_enabled)
1616 acpi_video_switch_brightness(video_device, event); 1611 acpi_video_switch_brightness(video_device, event);
1617 acpi_bus_generate_proc_event(device, event, 0);
1618 keycode = KEY_BRIGHTNESS_CYCLE; 1612 keycode = KEY_BRIGHTNESS_CYCLE;
1619 break; 1613 break;
1620 case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */ 1614 case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */
1621 if (brightness_switch_enabled) 1615 if (brightness_switch_enabled)
1622 acpi_video_switch_brightness(video_device, event); 1616 acpi_video_switch_brightness(video_device, event);
1623 acpi_bus_generate_proc_event(device, event, 0);
1624 keycode = KEY_BRIGHTNESSUP; 1617 keycode = KEY_BRIGHTNESSUP;
1625 break; 1618 break;
1626 case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */ 1619 case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */
1627 if (brightness_switch_enabled) 1620 if (brightness_switch_enabled)
1628 acpi_video_switch_brightness(video_device, event); 1621 acpi_video_switch_brightness(video_device, event);
1629 acpi_bus_generate_proc_event(device, event, 0);
1630 keycode = KEY_BRIGHTNESSDOWN; 1622 keycode = KEY_BRIGHTNESSDOWN;
1631 break; 1623 break;
1632 case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightness */ 1624 case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightness */
1633 if (brightness_switch_enabled) 1625 if (brightness_switch_enabled)
1634 acpi_video_switch_brightness(video_device, event); 1626 acpi_video_switch_brightness(video_device, event);
1635 acpi_bus_generate_proc_event(device, event, 0);
1636 keycode = KEY_BRIGHTNESS_ZERO; 1627 keycode = KEY_BRIGHTNESS_ZERO;
1637 break; 1628 break;
1638 case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */ 1629 case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */
1639 if (brightness_switch_enabled) 1630 if (brightness_switch_enabled)
1640 acpi_video_switch_brightness(video_device, event); 1631 acpi_video_switch_brightness(video_device, event);
1641 acpi_bus_generate_proc_event(device, event, 0);
1642 keycode = KEY_DISPLAY_OFF; 1632 keycode = KEY_DISPLAY_OFF;
1643 break; 1633 break;
1644 default: 1634 default:
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index bf2349dbbf7f..7cc1fe2241fd 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -876,11 +876,6 @@ found:
876 if (useinput) 876 if (useinput)
877 sonypi_report_input_event(event); 877 sonypi_report_input_event(event);
878 878
879#ifdef CONFIG_ACPI
880 if (sonypi_acpi_device)
881 acpi_bus_generate_proc_event(sonypi_acpi_device, 1, event);
882#endif
883
884 kfifo_in_locked(&sonypi_device.fifo, (unsigned char *)&event, 879 kfifo_in_locked(&sonypi_device.fifo, (unsigned char *)&event,
885 sizeof(event), &sonypi_device.fifo_lock); 880 sizeof(event), &sonypi_device.fifo_lock);
886 kill_fasync(&sonypi_device.fifo_async, SIGIO, POLL_IN); 881 kill_fasync(&sonypi_device.fifo_async, SIGIO, POLL_IN);
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 8d45f6d69540..2f5786c8522c 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -270,7 +270,6 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
270 270
271 if (subevent == 0x80) { 271 if (subevent == 0x80) {
272 dbg("%s: generationg bus event\n", __func__); 272 dbg("%s: generationg bus event\n", __func__);
273 acpi_bus_generate_proc_event(note->device, note->event, detail);
274 acpi_bus_generate_netlink_event(note->device->pnp.device_class, 273 acpi_bus_generate_netlink_event(note->device->pnp.device_class,
275 dev_name(&note->device->dev), 274 dev_name(&note->device->dev),
276 note->event, detail); 275 note->event, detail);
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 8e268da6fdbd..0e9c169b42f8 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -1543,7 +1543,6 @@ static void asus_acpi_notify(struct acpi_device *device, u32 event)
1543 1543
1544 /* TODO Find a better way to handle events count. */ 1544 /* TODO Find a better way to handle events count. */
1545 count = asus->event_count[event % 128]++; 1545 count = asus->event_count[event % 128]++;
1546 acpi_bus_generate_proc_event(asus->device, event, count);
1547 acpi_bus_generate_netlink_event(asus->device->pnp.device_class, 1546 acpi_bus_generate_netlink_event(asus->device->pnp.device_class,
1548 dev_name(&asus->device->dev), event, 1547 dev_name(&asus->device->dev), event,
1549 count); 1548 count);
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 5d26e70bed6c..a6afd4108beb 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -1269,7 +1269,6 @@ static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
1269 if (event > ACPI_MAX_SYS_NOTIFY) 1269 if (event > ACPI_MAX_SYS_NOTIFY)
1270 return; 1270 return;
1271 count = eeepc->event_count[event % 128]++; 1271 count = eeepc->event_count[event % 128]++;
1272 acpi_bus_generate_proc_event(device, event, count);
1273 acpi_bus_generate_netlink_event(device->pnp.device_class, 1272 acpi_bus_generate_netlink_event(device->pnp.device_class,
1274 dev_name(&device->dev), event, 1273 dev_name(&device->dev), event,
1275 count); 1274 count);
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 1c9386e7c58c..52b8a97efde1 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -773,8 +773,6 @@ static void acpi_fujitsu_notify(struct acpi_device *device, u32 event)
773 else 773 else
774 set_lcd_level(newb); 774 set_lcd_level(newb);
775 } 775 }
776 acpi_bus_generate_proc_event(fujitsu->dev,
777 ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS, 0);
778 keycode = KEY_BRIGHTNESSUP; 776 keycode = KEY_BRIGHTNESSUP;
779 } else if (oldb > newb) { 777 } else if (oldb > newb) {
780 if (disable_brightness_adjust != 1) { 778 if (disable_brightness_adjust != 1) {
@@ -783,8 +781,6 @@ static void acpi_fujitsu_notify(struct acpi_device *device, u32 event)
783 else 781 else
784 set_lcd_level(newb); 782 set_lcd_level(newb);
785 } 783 }
786 acpi_bus_generate_proc_event(fujitsu->dev,
787 ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS, 0);
788 keycode = KEY_BRIGHTNESSDOWN; 784 keycode = KEY_BRIGHTNESSDOWN;
789 } 785 }
790 break; 786 break;
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index 4add9a31bf60..984253da365d 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -464,9 +464,6 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
464 "error getting hotkey status\n")); 464 "error getting hotkey status\n"));
465 return; 465 return;
466 } 466 }
467
468 acpi_bus_generate_proc_event(pcc->device, HKEY_NOTIFY, result);
469
470 if (!sparse_keymap_report_event(hotk_input_dev, 467 if (!sparse_keymap_report_event(hotk_input_dev,
471 result & 0xf, result & 0x80, false)) 468 result & 0xf, result & 0x80, false))
472 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 469 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 3a1b6bf326a8..d3fd52036fd6 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1275,9 +1275,6 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
1275 ev_type = HOTKEY; 1275 ev_type = HOTKEY;
1276 sony_laptop_report_input_event(real_ev); 1276 sony_laptop_report_input_event(real_ev);
1277 } 1277 }
1278
1279 acpi_bus_generate_proc_event(sony_nc_acpi_device, ev_type, real_ev);
1280
1281 acpi_bus_generate_netlink_event(sony_nc_acpi_device->pnp.device_class, 1278 acpi_bus_generate_netlink_event(sony_nc_acpi_device->pnp.device_class,
1282 dev_name(&sony_nc_acpi_device->dev), ev_type, real_ev); 1279 dev_name(&sony_nc_acpi_device->dev), ev_type, real_ev);
1283} 1280}
@@ -4246,7 +4243,6 @@ static irqreturn_t sony_pic_irq(int irq, void *dev_id)
4246 4243
4247found: 4244found:
4248 sony_laptop_report_input_event(device_event); 4245 sony_laptop_report_input_event(device_event);
4249 acpi_bus_generate_proc_event(dev->acpi_dev, 1, device_event);
4250 sonypi_compat_report_event(device_event); 4246 sonypi_compat_report_event(device_event);
4251 return IRQ_HANDLED; 4247 return IRQ_HANDLED;
4252} 4248}
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 54d31c0a9840..be67e5e28d18 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2022,8 +2022,6 @@ static u32 hotkey_driver_mask; /* events needed by the driver */
2022static u32 hotkey_user_mask; /* events visible to userspace */ 2022static u32 hotkey_user_mask; /* events visible to userspace */
2023static u32 hotkey_acpi_mask; /* events enabled in firmware */ 2023static u32 hotkey_acpi_mask; /* events enabled in firmware */
2024 2024
2025static unsigned int hotkey_report_mode;
2026
2027static u16 *hotkey_keycode_map; 2025static u16 *hotkey_keycode_map;
2028 2026
2029static struct attribute_set *hotkey_dev_attributes; 2027static struct attribute_set *hotkey_dev_attributes;
@@ -2282,10 +2280,6 @@ static struct tp_acpi_drv_struct ibm_hotkey_acpidriver;
2282static void tpacpi_hotkey_send_key(unsigned int scancode) 2280static void tpacpi_hotkey_send_key(unsigned int scancode)
2283{ 2281{
2284 tpacpi_input_send_key_masked(scancode); 2282 tpacpi_input_send_key_masked(scancode);
2285 if (hotkey_report_mode < 2) {
2286 acpi_bus_generate_proc_event(ibm_hotkey_acpidriver.device,
2287 0x80, TP_HKEY_EV_HOTKEY_BASE + scancode);
2288 }
2289} 2283}
2290 2284
2291static void hotkey_read_nvram(struct tp_nvram_state *n, const u32 m) 2285static void hotkey_read_nvram(struct tp_nvram_state *n, const u32 m)
@@ -2882,18 +2876,6 @@ static void hotkey_tablet_mode_notify_change(void)
2882 "hotkey_tablet_mode"); 2876 "hotkey_tablet_mode");
2883} 2877}
2884 2878
2885/* sysfs hotkey report_mode -------------------------------------------- */
2886static ssize_t hotkey_report_mode_show(struct device *dev,
2887 struct device_attribute *attr,
2888 char *buf)
2889{
2890 return snprintf(buf, PAGE_SIZE, "%d\n",
2891 (hotkey_report_mode != 0) ? hotkey_report_mode : 1);
2892}
2893
2894static struct device_attribute dev_attr_hotkey_report_mode =
2895 __ATTR(hotkey_report_mode, S_IRUGO, hotkey_report_mode_show, NULL);
2896
2897/* sysfs wakeup reason (pollable) -------------------------------------- */ 2879/* sysfs wakeup reason (pollable) -------------------------------------- */
2898static ssize_t hotkey_wakeup_reason_show(struct device *dev, 2880static ssize_t hotkey_wakeup_reason_show(struct device *dev,
2899 struct device_attribute *attr, 2881 struct device_attribute *attr,
@@ -2935,7 +2917,6 @@ static struct attribute *hotkey_attributes[] __initdata = {
2935 &dev_attr_hotkey_enable.attr, 2917 &dev_attr_hotkey_enable.attr,
2936 &dev_attr_hotkey_bios_enabled.attr, 2918 &dev_attr_hotkey_bios_enabled.attr,
2937 &dev_attr_hotkey_bios_mask.attr, 2919 &dev_attr_hotkey_bios_mask.attr,
2938 &dev_attr_hotkey_report_mode.attr,
2939 &dev_attr_hotkey_wakeup_reason.attr, 2920 &dev_attr_hotkey_wakeup_reason.attr,
2940 &dev_attr_hotkey_wakeup_hotunplug_complete.attr, 2921 &dev_attr_hotkey_wakeup_hotunplug_complete.attr,
2941 &dev_attr_hotkey_mask.attr, 2922 &dev_attr_hotkey_mask.attr,
@@ -3439,11 +3420,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
3439 "initial masks: user=0x%08x, fw=0x%08x, poll=0x%08x\n", 3420 "initial masks: user=0x%08x, fw=0x%08x, poll=0x%08x\n",
3440 hotkey_user_mask, hotkey_acpi_mask, hotkey_source_mask); 3421 hotkey_user_mask, hotkey_acpi_mask, hotkey_source_mask);
3441 3422
3442 dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
3443 "legacy ibm/hotkey event reporting over procfs %s\n",
3444 (hotkey_report_mode < 2) ?
3445 "enabled" : "disabled");
3446
3447 tpacpi_inputdev->open = &hotkey_inputdev_open; 3423 tpacpi_inputdev->open = &hotkey_inputdev_open;
3448 tpacpi_inputdev->close = &hotkey_inputdev_close; 3424 tpacpi_inputdev->close = &hotkey_inputdev_close;
3449 3425
@@ -3737,13 +3713,6 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3737 "event happened to %s\n", TPACPI_MAIL); 3713 "event happened to %s\n", TPACPI_MAIL);
3738 } 3714 }
3739 3715
3740 /* Legacy events */
3741 if (!ignore_acpi_ev &&
3742 (send_acpi_ev || hotkey_report_mode < 2)) {
3743 acpi_bus_generate_proc_event(ibm->acpi->device,
3744 event, hkey);
3745 }
3746
3747 /* netlink events */ 3716 /* netlink events */
3748 if (!ignore_acpi_ev && send_acpi_ev) { 3717 if (!ignore_acpi_ev && send_acpi_ev) {
3749 acpi_bus_generate_netlink_event( 3718 acpi_bus_generate_netlink_event(
@@ -8840,11 +8809,6 @@ module_param(brightness_enable, uint, 0444);
8840MODULE_PARM_DESC(brightness_enable, 8809MODULE_PARM_DESC(brightness_enable,
8841 "Enables backlight control when 1, disables when 0"); 8810 "Enables backlight control when 1, disables when 0");
8842 8811
8843module_param(hotkey_report_mode, uint, 0444);
8844MODULE_PARM_DESC(hotkey_report_mode,
8845 "used for backwards compatibility with userspace, "
8846 "see documentation");
8847
8848#ifdef CONFIG_THINKPAD_ACPI_ALSA_SUPPORT 8812#ifdef CONFIG_THINKPAD_ACPI_ALSA_SUPPORT
8849module_param_named(volume_mode, volume_mode, uint, 0444); 8813module_param_named(volume_mode, volume_mode, uint, 0444);
8850MODULE_PARM_DESC(volume_mode, 8814MODULE_PARM_DESC(volume_mode,
@@ -8975,10 +8939,6 @@ static int __init thinkpad_acpi_module_init(void)
8975 8939
8976 tpacpi_lifecycle = TPACPI_LIFE_INIT; 8940 tpacpi_lifecycle = TPACPI_LIFE_INIT;
8977 8941
8978 /* Parameter checking */
8979 if (hotkey_report_mode > 2)
8980 return -EINVAL;
8981
8982 /* Driver-level probe */ 8942 /* Driver-level probe */
8983 8943
8984 ret = get_thinkpad_model_data(&thinkpad_id); 8944 ret = get_thinkpad_model_data(&thinkpad_id);
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 5852c20760a3..22650cd9e72a 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -367,7 +367,6 @@ extern int unregister_acpi_notifier(struct notifier_block *);
367 */ 367 */
368 368
369int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); 369int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
370void acpi_bus_data_handler(acpi_handle handle, void *context);
371acpi_status acpi_bus_get_status_handle(acpi_handle handle, 370acpi_status acpi_bus_get_status_handle(acpi_handle handle,
372 unsigned long long *sta); 371 unsigned long long *sta);
373int acpi_bus_get_status(struct acpi_device *device); 372int acpi_bus_get_status(struct acpi_device *device);
@@ -387,15 +386,6 @@ bool acpi_bus_can_wakeup(acpi_handle handle);
387static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; } 386static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; }
388#endif 387#endif
389 388
390#ifdef CONFIG_ACPI_PROC_EVENT
391int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
392int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);
393int acpi_bus_receive_event(struct acpi_bus_event *event);
394#else
395static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
396 { return 0; }
397#endif
398
399void acpi_scan_lock_acquire(void); 389void acpi_scan_lock_acquire(void);
400void acpi_scan_lock_release(void); 390void acpi_scan_lock_release(void);
401int acpi_scan_add_handler(struct acpi_scan_handler *handler); 391int acpi_scan_add_handler(struct acpi_scan_handler *handler);
diff --git a/lib/earlycpio.c b/lib/earlycpio.c
index 7aa7ce250c94..3eb3e4722b8e 100644
--- a/lib/earlycpio.c
+++ b/lib/earlycpio.c
@@ -49,22 +49,23 @@ enum cpio_fields {
49 49
50/** 50/**
51 * cpio_data find_cpio_data - Search for files in an uncompressed cpio 51 * cpio_data find_cpio_data - Search for files in an uncompressed cpio
52 * @path: The directory to search for, including a slash at the end 52 * @path: The directory to search for, including a slash at the end
53 * @data: Pointer to the the cpio archive or a header inside 53 * @data: Pointer to the the cpio archive or a header inside
54 * @len: Remaining length of the cpio based on data pointer 54 * @len: Remaining length of the cpio based on data pointer
55 * @offset: When a matching file is found, this is the offset to the 55 * @nextoff: When a matching file is found, this is the offset from the
56 * beginning of the cpio. It can be used to iterate through 56 * beginning of the cpio to the beginning of the next file, not the
57 * the cpio to find all files inside of a directory path 57 * matching file itself. It can be used to iterate through the cpio
58 * to find all files inside of a directory path.
58 * 59 *
59 * @return: struct cpio_data containing the address, length and 60 * @return: struct cpio_data containing the address, length and
60 * filename (with the directory path cut off) of the found file. 61 * filename (with the directory path cut off) of the found file.
61 * If you search for a filename and not for files in a directory, 62 * If you search for a filename and not for files in a directory,
62 * pass the absolute path of the filename in the cpio and make sure 63 * pass the absolute path of the filename in the cpio and make sure
63 * the match returned an empty filename string. 64 * the match returned an empty filename string.
64 */ 65 */
65 66
66struct cpio_data find_cpio_data(const char *path, void *data, 67struct cpio_data find_cpio_data(const char *path, void *data,
67 size_t len, long *offset) 68 size_t len, long *nextoff)
68{ 69{
69 const size_t cpio_header_len = 8*C_NFIELDS - 2; 70 const size_t cpio_header_len = 8*C_NFIELDS - 2;
70 struct cpio_data cd = { NULL, 0, "" }; 71 struct cpio_data cd = { NULL, 0, "" };
@@ -124,7 +125,7 @@ struct cpio_data find_cpio_data(const char *path, void *data,
124 if ((ch[C_MODE] & 0170000) == 0100000 && 125 if ((ch[C_MODE] & 0170000) == 0100000 &&
125 ch[C_NAMESIZE] >= mypathsize && 126 ch[C_NAMESIZE] >= mypathsize &&
126 !memcmp(p, path, mypathsize)) { 127 !memcmp(p, path, mypathsize)) {
127 *offset = (long)nptr - (long)data; 128 *nextoff = (long)nptr - (long)data;
128 if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) { 129 if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
129 pr_warn( 130 pr_warn(
130 "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n", 131 "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",