aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ac.c3
-rw-r--r--drivers/acpi/acpi_extlog.c1
-rw-r--r--drivers/acpi/acpi_pad.c3
-rw-r--r--drivers/acpi/apei/apei-base.c1
-rw-r--r--drivers/acpi/apei/apei-internal.h1
-rw-r--r--drivers/acpi/apei/einj.c1
-rw-r--r--drivers/acpi/apei/ghes.c1
-rw-r--r--drivers/acpi/battery.c3
-rw-r--r--drivers/acpi/blacklist.c1
-rw-r--r--drivers/acpi/bus.c2
-rw-r--r--drivers/acpi/button.c3
-rw-r--r--drivers/acpi/custom_method.c2
-rw-r--r--drivers/acpi/debugfs.c2
-rw-r--r--drivers/acpi/dock.c7
-rw-r--r--drivers/acpi/ec.c30
-rw-r--r--drivers/acpi/ec_sys.c2
-rw-r--r--drivers/acpi/event.c2
-rw-r--r--drivers/acpi/fan.c3
-rw-r--r--drivers/acpi/hed.c2
-rw-r--r--drivers/acpi/internal.h9
-rw-r--r--drivers/acpi/numa.c1
-rw-r--r--drivers/acpi/nvs.c3
-rw-r--r--drivers/acpi/osl.c8
-rw-r--r--drivers/acpi/pci_irq.c2
-rw-r--r--drivers/acpi/pci_link.c4
-rw-r--r--drivers/acpi/pci_root.c4
-rw-r--r--drivers/acpi/pci_slot.c1
-rw-r--r--drivers/acpi/power.c3
-rw-r--r--drivers/acpi/proc.c5
-rw-r--r--drivers/acpi/processor_core.c3
-rw-r--r--drivers/acpi/processor_driver.c8
-rw-r--r--drivers/acpi/processor_idle.c8
-rw-r--r--drivers/acpi/processor_perflib.c7
-rw-r--r--drivers/acpi/processor_thermal.c11
-rw-r--r--drivers/acpi/processor_throttling.c7
-rw-r--r--drivers/acpi/sbshc.c3
-rw-r--r--drivers/acpi/scan.c2
-rw-r--r--drivers/acpi/sleep.c7
-rw-r--r--drivers/acpi/sysfs.c2
-rw-r--r--drivers/acpi/tables.c11
-rw-r--r--drivers/acpi/thermal.c5
-rw-r--r--drivers/acpi/utils.c2
-rw-r--r--drivers/acpi/video.c5
-rw-r--r--drivers/acpi/wakeup.c1
44 files changed, 61 insertions, 131 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 3c2e4aa529c4..e7515aa43d6b 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -32,8 +32,7 @@
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/platform_device.h> 33#include <linux/platform_device.h>
34#include <linux/power_supply.h> 34#include <linux/power_supply.h>
35#include <acpi/acpi_bus.h> 35#include <linux/acpi.h>
36#include <acpi/acpi_drivers.h>
37 36
38#define PREFIX "ACPI: " 37#define PREFIX "ACPI: "
39 38
diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
index a6869e110ce5..2635a01c5b3e 100644
--- a/drivers/acpi/acpi_extlog.c
+++ b/drivers/acpi/acpi_extlog.c
@@ -9,7 +9,6 @@
9 9
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/acpi.h> 11#include <linux/acpi.h>
12#include <acpi/acpi_bus.h>
13#include <linux/cper.h> 12#include <linux/cper.h>
14#include <linux/ratelimit.h> 13#include <linux/ratelimit.h>
15#include <asm/cpu.h> 14#include <asm/cpu.h>
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index fc6008fbce35..65610c0e7243 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -28,8 +28,7 @@
28#include <linux/cpu.h> 28#include <linux/cpu.h>
29#include <linux/clockchips.h> 29#include <linux/clockchips.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <acpi/acpi_bus.h> 31#include <linux/acpi.h>
32#include <acpi/acpi_drivers.h>
33#include <asm/mwait.h> 32#include <asm/mwait.h>
34 33
35#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad" 34#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad"
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index 6d2c49b86b7f..0760b75f79cc 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -34,7 +34,6 @@
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/acpi.h> 36#include <linux/acpi.h>
37#include <linux/acpi_io.h>
38#include <linux/slab.h> 37#include <linux/slab.h>
39#include <linux/io.h> 38#include <linux/io.h>
40#include <linux/kref.h> 39#include <linux/kref.h>
diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
index 21ba34a73883..e5bcd919d4e6 100644
--- a/drivers/acpi/apei/apei-internal.h
+++ b/drivers/acpi/apei/apei-internal.h
@@ -8,7 +8,6 @@
8 8
9#include <linux/cper.h> 9#include <linux/cper.h>
10#include <linux/acpi.h> 10#include <linux/acpi.h>
11#include <linux/acpi_io.h>
12 11
13struct apei_exec_context; 12struct apei_exec_context;
14 13
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index fb57d03e698b..ca0c6d7ec0d4 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -33,7 +33,6 @@
33#include <linux/nmi.h> 33#include <linux/nmi.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35#include <linux/mm.h> 35#include <linux/mm.h>
36#include <acpi/acpi.h>
37 36
38#include "apei-internal.h" 37#include "apei-internal.h"
39 38
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index a30bc313787b..694c486a12ed 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -33,7 +33,6 @@
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/acpi.h> 35#include <linux/acpi.h>
36#include <linux/acpi_io.h>
37#include <linux/io.h> 36#include <linux/io.h>
38#include <linux/interrupt.h> 37#include <linux/interrupt.h>
39#include <linux/timer.h> 38#include <linux/timer.h>
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 5876a49dfd38..470e7542bf31 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -36,8 +36,7 @@
36#include <linux/suspend.h> 36#include <linux/suspend.h>
37#include <asm/unaligned.h> 37#include <asm/unaligned.h>
38 38
39#include <acpi/acpi_bus.h> 39#include <linux/acpi.h>
40#include <acpi/acpi_drivers.h>
41#include <linux/power_supply.h> 40#include <linux/power_supply.h>
42 41
43#define PREFIX "ACPI: " 42#define PREFIX "ACPI: "
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index 078c4f7fe2dd..05ee8f61bfb5 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -30,7 +30,6 @@
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/acpi.h> 32#include <linux/acpi.h>
33#include <acpi/acpi_bus.h>
34#include <linux/dmi.h> 33#include <linux/dmi.h>
35 34
36#include "internal.h" 35#include "internal.h"
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 0710004055c8..1d8c2bb905fe 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -37,8 +37,6 @@
37#include <asm/mpspec.h> 37#include <asm/mpspec.h>
38#endif 38#endif
39#include <linux/pci.h> 39#include <linux/pci.h>
40#include <acpi/acpi_bus.h>
41#include <acpi/acpi_drivers.h>
42#include <acpi/apei.h> 40#include <acpi/apei.h>
43#include <linux/dmi.h> 41#include <linux/dmi.h>
44#include <linux/suspend.h> 42#include <linux/suspend.h>
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index c971929d75c2..9e3a6cb99f90 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -31,8 +31,7 @@
31#include <linux/seq_file.h> 31#include <linux/seq_file.h>
32#include <linux/input.h> 32#include <linux/input.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <acpi/acpi_bus.h> 34#include <linux/acpi.h>
35#include <acpi/acpi_drivers.h>
36#include <acpi/button.h> 35#include <acpi/button.h>
37 36
38#define PREFIX "ACPI: " 37#define PREFIX "ACPI: "
diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c
index 12b62f2cdb3f..c68e72414a67 100644
--- a/drivers/acpi/custom_method.c
+++ b/drivers/acpi/custom_method.c
@@ -7,7 +7,7 @@
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/uaccess.h> 8#include <linux/uaccess.h>
9#include <linux/debugfs.h> 9#include <linux/debugfs.h>
10#include <acpi/acpi_drivers.h> 10#include <linux/acpi.h>
11 11
12#include "internal.h" 12#include "internal.h"
13 13
diff --git a/drivers/acpi/debugfs.c b/drivers/acpi/debugfs.c
index b55d6a20dc0e..6b1919f6bd82 100644
--- a/drivers/acpi/debugfs.c
+++ b/drivers/acpi/debugfs.c
@@ -5,7 +5,7 @@
5#include <linux/export.h> 5#include <linux/export.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/debugfs.h> 7#include <linux/debugfs.h>
8#include <acpi/acpi_drivers.h> 8#include <linux/acpi.h>
9 9
10#define _COMPONENT ACPI_SYSTEM_COMPONENT 10#define _COMPONENT ACPI_SYSTEM_COMPONENT
11ACPI_MODULE_NAME("debugfs"); 11ACPI_MODULE_NAME("debugfs");
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index dcd73ccb514c..38c2e325f325 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -32,8 +32,8 @@
32#include <linux/jiffies.h> 32#include <linux/jiffies.h>
33#include <linux/stddef.h> 33#include <linux/stddef.h>
34#include <linux/acpi.h> 34#include <linux/acpi.h>
35#include <acpi/acpi_bus.h> 35
36#include <acpi/acpi_drivers.h> 36#include "internal.h"
37 37
38#define PREFIX "ACPI: " 38#define PREFIX "ACPI: "
39 39
@@ -898,9 +898,6 @@ find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
898 898
899void __init acpi_dock_init(void) 899void __init acpi_dock_init(void)
900{ 900{
901 if (acpi_disabled)
902 return;
903
904 /* look for dock stations and bays */ 901 /* look for dock stations and bays */
905 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 902 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
906 ACPI_UINT32_MAX, find_dock_and_bay, NULL, NULL, NULL); 903 ACPI_UINT32_MAX, find_dock_and_bay, NULL, NULL, NULL);
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index ba5b56db9d27..47b1111afc90 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -39,10 +39,9 @@
39#include <linux/list.h> 39#include <linux/list.h>
40#include <linux/spinlock.h> 40#include <linux/spinlock.h>
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <asm/io.h> 42#include <linux/acpi.h>
43#include <acpi/acpi_bus.h>
44#include <acpi/acpi_drivers.h>
45#include <linux/dmi.h> 43#include <linux/dmi.h>
44#include <asm/io.h>
46 45
47#include "internal.h" 46#include "internal.h"
48 47
@@ -91,10 +90,6 @@ static unsigned int ec_storm_threshold __read_mostly = 8;
91module_param(ec_storm_threshold, uint, 0644); 90module_param(ec_storm_threshold, uint, 0644);
92MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm"); 91MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");
93 92
94/* If we find an EC via the ECDT, we need to keep a ptr to its context */
95/* External interfaces use first EC only, so remember */
96typedef int (*acpi_ec_query_func) (void *data);
97
98struct acpi_ec_query_handler { 93struct acpi_ec_query_handler {
99 struct list_head node; 94 struct list_head node;
100 acpi_ec_query_func func; 95 acpi_ec_query_func func;
@@ -387,27 +382,6 @@ static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data)
387 return acpi_ec_transaction(ec, &t); 382 return acpi_ec_transaction(ec, &t);
388} 383}
389 384
390/*
391 * Externally callable EC access functions. For now, assume 1 EC only
392 */
393int ec_burst_enable(void)
394{
395 if (!first_ec)
396 return -ENODEV;
397 return acpi_ec_burst_enable(first_ec);
398}
399
400EXPORT_SYMBOL(ec_burst_enable);
401
402int ec_burst_disable(void)
403{
404 if (!first_ec)
405 return -ENODEV;
406 return acpi_ec_burst_disable(first_ec);
407}
408
409EXPORT_SYMBOL(ec_burst_disable);
410
411int ec_read(u8 addr, u8 *val) 385int ec_read(u8 addr, u8 *val)
412{ 386{
413 int err; 387 int err;
diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
index 4e7b798900f2..b4c216bab22b 100644
--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
@@ -105,7 +105,7 @@ static const struct file_operations acpi_ec_io_ops = {
105 .llseek = default_llseek, 105 .llseek = default_llseek,
106}; 106};
107 107
108int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count) 108static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
109{ 109{
110 struct dentry *dev_dir; 110 struct dentry *dev_dir;
111 char name[64]; 111 char name[64];
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index cae3b387b867..ef2d730734dc 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -12,7 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/poll.h> 13#include <linux/poll.h>
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <acpi/acpi_drivers.h> 15#include <linux/acpi.h>
16#include <net/netlink.h> 16#include <net/netlink.h>
17#include <net/genetlink.h> 17#include <net/genetlink.h>
18 18
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index ba3da88cee45..1fb62900f32a 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -29,8 +29,7 @@
29#include <linux/types.h> 29#include <linux/types.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <linux/thermal.h> 31#include <linux/thermal.h>
32#include <acpi/acpi_bus.h> 32#include <linux/acpi.h>
33#include <acpi/acpi_drivers.h>
34 33
35#define PREFIX "ACPI: " 34#define PREFIX "ACPI: "
36 35
diff --git a/drivers/acpi/hed.c b/drivers/acpi/hed.c
index 13b1d39d7cdf..aafe3ca829c2 100644
--- a/drivers/acpi/hed.c
+++ b/drivers/acpi/hed.c
@@ -25,8 +25,6 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/acpi.h> 27#include <linux/acpi.h>
28#include <acpi/acpi_bus.h>
29#include <acpi/acpi_drivers.h>
30#include <acpi/hed.h> 28#include <acpi/hed.h>
31 29
32static struct acpi_device_id acpi_hed_ids[] = { 30static struct acpi_device_id acpi_hed_ids[] = {
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index a29739c0ba79..8ef9787dead4 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -127,12 +127,21 @@ struct acpi_ec {
127 127
128extern struct acpi_ec *first_ec; 128extern struct acpi_ec *first_ec;
129 129
130/* If we find an EC via the ECDT, we need to keep a ptr to its context */
131/* External interfaces use first EC only, so remember */
132typedef int (*acpi_ec_query_func) (void *data);
133
130int acpi_ec_init(void); 134int acpi_ec_init(void);
131int acpi_ec_ecdt_probe(void); 135int acpi_ec_ecdt_probe(void);
132int acpi_boot_ec_enable(void); 136int acpi_boot_ec_enable(void);
133void acpi_ec_block_transactions(void); 137void acpi_ec_block_transactions(void);
134void acpi_ec_unblock_transactions(void); 138void acpi_ec_unblock_transactions(void);
135void acpi_ec_unblock_transactions_early(void); 139void acpi_ec_unblock_transactions_early(void);
140int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
141 acpi_handle handle, acpi_ec_query_func func,
142 void *data);
143void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit);
144
136 145
137/*-------------------------------------------------------------------------- 146/*--------------------------------------------------------------------------
138 Suspend/Resume 147 Suspend/Resume
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index a2343a1d9e0b..9e6816ef280a 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -29,7 +29,6 @@
29#include <linux/errno.h> 29#include <linux/errno.h>
30#include <linux/acpi.h> 30#include <linux/acpi.h>
31#include <linux/numa.h> 31#include <linux/numa.h>
32#include <acpi/acpi_bus.h>
33 32
34#define PREFIX "ACPI: " 33#define PREFIX "ACPI: "
35 34
diff --git a/drivers/acpi/nvs.c b/drivers/acpi/nvs.c
index 386a9fe497b4..de4fe03873c5 100644
--- a/drivers/acpi/nvs.c
+++ b/drivers/acpi/nvs.c
@@ -12,7 +12,8 @@
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/acpi.h> 14#include <linux/acpi.h>
15#include <linux/acpi_io.h> 15
16#include "internal.h"
16 17
17/* ACPI NVS regions, APEI may use it */ 18/* ACPI NVS regions, APEI may use it */
18 19
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 54a20ff4b864..7865a8069340 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -39,7 +39,6 @@
39#include <linux/workqueue.h> 39#include <linux/workqueue.h>
40#include <linux/nmi.h> 40#include <linux/nmi.h>
41#include <linux/acpi.h> 41#include <linux/acpi.h>
42#include <linux/acpi_io.h>
43#include <linux/efi.h> 42#include <linux/efi.h>
44#include <linux/ioport.h> 43#include <linux/ioport.h>
45#include <linux/list.h> 44#include <linux/list.h>
@@ -49,9 +48,6 @@
49#include <asm/io.h> 48#include <asm/io.h>
50#include <asm/uaccess.h> 49#include <asm/uaccess.h>
51 50
52#include <acpi/acpi.h>
53#include <acpi/acpi_bus.h>
54#include <acpi/processor.h>
55#include "internal.h" 51#include "internal.h"
56 52
57#define _COMPONENT ACPI_OS_SERVICES 53#define _COMPONENT ACPI_OS_SERVICES
@@ -544,7 +540,7 @@ static u64 acpi_tables_addr;
544static int all_tables_size; 540static int all_tables_size;
545 541
546/* Copied from acpica/tbutils.c:acpi_tb_checksum() */ 542/* Copied from acpica/tbutils.c:acpi_tb_checksum() */
547u8 __init acpi_table_checksum(u8 *buffer, u32 length) 543static u8 __init acpi_table_checksum(u8 *buffer, u32 length)
548{ 544{
549 u8 sum = 0; 545 u8 sum = 0;
550 u8 *end = buffer + length; 546 u8 *end = buffer + length;
@@ -1282,7 +1278,7 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
1282 jiffies = MAX_SCHEDULE_TIMEOUT; 1278 jiffies = MAX_SCHEDULE_TIMEOUT;
1283 else 1279 else
1284 jiffies = msecs_to_jiffies(timeout); 1280 jiffies = msecs_to_jiffies(timeout);
1285 1281
1286 ret = down_timeout(sem, jiffies); 1282 ret = down_timeout(sem, jiffies);
1287 if (ret) 1283 if (ret)
1288 status = AE_TIME; 1284 status = AE_TIME;
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 41c5e1b799ef..52d45ea2bc4f 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -37,8 +37,6 @@
37#include <linux/pci.h> 37#include <linux/pci.h>
38#include <linux/acpi.h> 38#include <linux/acpi.h>
39#include <linux/slab.h> 39#include <linux/slab.h>
40#include <acpi/acpi_bus.h>
41#include <acpi/acpi_drivers.h>
42 40
43#define PREFIX "ACPI: " 41#define PREFIX "ACPI: "
44 42
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 2652a614deeb..9418c7a1f786 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -39,9 +39,9 @@
39#include <linux/pci.h> 39#include <linux/pci.h>
40#include <linux/mutex.h> 40#include <linux/mutex.h>
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/acpi.h>
42 43
43#include <acpi/acpi_bus.h> 44#include "internal.h"
44#include <acpi/acpi_drivers.h>
45 45
46#define PREFIX "ACPI: " 46#define PREFIX "ACPI: "
47 47
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 20360e480bd8..33f554bc43b4 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -35,9 +35,7 @@
35#include <linux/pci-aspm.h> 35#include <linux/pci-aspm.h>
36#include <linux/acpi.h> 36#include <linux/acpi.h>
37#include <linux/slab.h> 37#include <linux/slab.h>
38#include <acpi/acpi_bus.h> 38#include <acpi/apei.h> /* for acpi_hest_init() */
39#include <acpi/acpi_drivers.h>
40#include <acpi/apei.h>
41 39
42#include "internal.h" 40#include "internal.h"
43 41
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
index d678a180ca2a..139d9e479370 100644
--- a/drivers/acpi/pci_slot.c
+++ b/drivers/acpi/pci_slot.c
@@ -35,6 +35,7 @@
35#include <linux/pci.h> 35#include <linux/pci.h>
36#include <linux/acpi.h> 36#include <linux/acpi.h>
37#include <linux/dmi.h> 37#include <linux/dmi.h>
38#include <linux/pci-acpi.h>
38 39
39static bool debug; 40static bool debug;
40static int check_sta_before_sun; 41static int check_sta_before_sun;
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index c2ad391d8041..ad7da686e6e6 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -42,8 +42,7 @@
42#include <linux/slab.h> 42#include <linux/slab.h>
43#include <linux/pm_runtime.h> 43#include <linux/pm_runtime.h>
44#include <linux/sysfs.h> 44#include <linux/sysfs.h>
45#include <acpi/acpi_bus.h> 45#include <linux/acpi.h>
46#include <acpi/acpi_drivers.h>
47#include "sleep.h" 46#include "sleep.h"
48#include "internal.h" 47#include "internal.h"
49 48
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c
index 6a5b152ad4d0..50fe34ffe932 100644
--- a/drivers/acpi/proc.c
+++ b/drivers/acpi/proc.c
@@ -3,12 +3,11 @@
3#include <linux/export.h> 3#include <linux/export.h>
4#include <linux/suspend.h> 4#include <linux/suspend.h>
5#include <linux/bcd.h> 5#include <linux/bcd.h>
6#include <linux/acpi.h>
6#include <asm/uaccess.h> 7#include <asm/uaccess.h>
7 8
8#include <acpi/acpi_bus.h>
9#include <acpi/acpi_drivers.h>
10
11#include "sleep.h" 9#include "sleep.h"
10#include "internal.h"
12 11
13#define _COMPONENT ACPI_SYSTEM_COMPONENT 12#define _COMPONENT ACPI_SYSTEM_COMPONENT
14 13
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index b3171f30b319..34e7b3c6a08d 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -10,8 +10,7 @@
10#include <linux/export.h> 10#include <linux/export.h>
11#include <linux/dmi.h> 11#include <linux/dmi.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13 13#include <linux/acpi.h>
14#include <acpi/acpi_drivers.h>
15#include <acpi/processor.h> 14#include <acpi/processor.h>
16 15
17#include "internal.h" 16#include "internal.h"
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 146ab7e2b81d..c1c35623550f 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -224,9 +224,9 @@ static int __acpi_processor_start(struct acpi_device *device)
224 224
225static int acpi_processor_start(struct device *dev) 225static int acpi_processor_start(struct device *dev)
226{ 226{
227 struct acpi_device *device; 227 struct acpi_device *device = ACPI_COMPANION(dev);
228 228
229 if (acpi_bus_get_device(ACPI_HANDLE(dev), &device)) 229 if (!device)
230 return -ENODEV; 230 return -ENODEV;
231 231
232 return __acpi_processor_start(device); 232 return __acpi_processor_start(device);
@@ -234,10 +234,10 @@ static int acpi_processor_start(struct device *dev)
234 234
235static int acpi_processor_stop(struct device *dev) 235static int acpi_processor_stop(struct device *dev)
236{ 236{
237 struct acpi_device *device; 237 struct acpi_device *device = ACPI_COMPANION(dev);
238 struct acpi_processor *pr; 238 struct acpi_processor *pr;
239 239
240 if (acpi_bus_get_device(ACPI_HANDLE(dev), &device)) 240 if (!device)
241 return 0; 241 return 0;
242 242
243 acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, 243 acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 644516d9bde6..799644c3888c 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -35,6 +35,7 @@
35#include <linux/clockchips.h> 35#include <linux/clockchips.h>
36#include <linux/cpuidle.h> 36#include <linux/cpuidle.h>
37#include <linux/syscore_ops.h> 37#include <linux/syscore_ops.h>
38#include <acpi/processor.h>
38 39
39/* 40/*
40 * Include the apic definitions for x86 to have the APIC timer related defines 41 * Include the apic definitions for x86 to have the APIC timer related defines
@@ -46,9 +47,6 @@
46#include <asm/apic.h> 47#include <asm/apic.h>
47#endif 48#endif
48 49
49#include <acpi/acpi_bus.h>
50#include <acpi/processor.h>
51
52#define PREFIX "ACPI: " 50#define PREFIX "ACPI: "
53 51
54#define ACPI_PROCESSOR_CLASS "processor" 52#define ACPI_PROCESSOR_CLASS "processor"
@@ -213,7 +211,7 @@ static int acpi_processor_suspend(void)
213 211
214static void acpi_processor_resume(void) 212static void acpi_processor_resume(void)
215{ 213{
216 u32 resumed_bm_rld; 214 u32 resumed_bm_rld = 0;
217 215
218 acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld); 216 acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld);
219 if (resumed_bm_rld == saved_bm_rld) 217 if (resumed_bm_rld == saved_bm_rld)
@@ -598,7 +596,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
598 case ACPI_STATE_C2: 596 case ACPI_STATE_C2:
599 if (!cx->address) 597 if (!cx->address)
600 break; 598 break;
601 cx->valid = 1; 599 cx->valid = 1;
602 break; 600 break;
603 601
604 case ACPI_STATE_C3: 602 case ACPI_STATE_C3:
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 60a7c28fc167..ff90054f04fd 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -31,15 +31,12 @@
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/cpufreq.h> 32#include <linux/cpufreq.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34 34#include <linux/acpi.h>
35#include <acpi/processor.h>
35#ifdef CONFIG_X86 36#ifdef CONFIG_X86
36#include <asm/cpufeature.h> 37#include <asm/cpufeature.h>
37#endif 38#endif
38 39
39#include <acpi/acpi_bus.h>
40#include <acpi/acpi_drivers.h>
41#include <acpi/processor.h>
42
43#define PREFIX "ACPI: " 40#define PREFIX "ACPI: "
44 41
45#define ACPI_PROCESSOR_CLASS "processor" 42#define ACPI_PROCESSOR_CLASS "processor"
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index d1d2e7fb5b30..e003663b2f8e 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -30,12 +30,9 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/cpufreq.h> 32#include <linux/cpufreq.h>
33 33#include <linux/acpi.h>
34#include <asm/uaccess.h>
35
36#include <acpi/acpi_bus.h>
37#include <acpi/processor.h> 34#include <acpi/processor.h>
38#include <acpi/acpi_drivers.h> 35#include <asm/uaccess.h>
39 36
40#define PREFIX "ACPI: " 37#define PREFIX "ACPI: "
41 38
@@ -186,14 +183,14 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
186 183
187#endif 184#endif
188 185
189/* thermal coolign device callbacks */ 186/* thermal cooling device callbacks */
190static int acpi_processor_max_state(struct acpi_processor *pr) 187static int acpi_processor_max_state(struct acpi_processor *pr)
191{ 188{
192 int max_state = 0; 189 int max_state = 0;
193 190
194 /* 191 /*
195 * There exists four states according to 192 * There exists four states according to
196 * cpufreq_thermal_reduction_ptg. 0, 1, 2, 3 193 * cpufreq_thermal_reduction_pctg. 0, 1, 2, 3
197 */ 194 */
198 max_state += cpufreq_get_max_state(pr->id); 195 max_state += cpufreq_get_max_state(pr->id);
199 if (pr->flags.throttling) 196 if (pr->flags.throttling)
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index e7dd2c1fee79..28baa05b8018 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -32,14 +32,11 @@
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/sched.h> 33#include <linux/sched.h>
34#include <linux/cpufreq.h> 34#include <linux/cpufreq.h>
35 35#include <linux/acpi.h>
36#include <acpi/processor.h>
36#include <asm/io.h> 37#include <asm/io.h>
37#include <asm/uaccess.h> 38#include <asm/uaccess.h>
38 39
39#include <acpi/acpi_bus.h>
40#include <acpi/acpi_drivers.h>
41#include <acpi/processor.h>
42
43#define PREFIX "ACPI: " 40#define PREFIX "ACPI: "
44 41
45#define ACPI_PROCESSOR_CLASS "processor" 42#define ACPI_PROCESSOR_CLASS "processor"
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
index b78bc605837e..26e5b5060523 100644
--- a/drivers/acpi/sbshc.c
+++ b/drivers/acpi/sbshc.c
@@ -8,8 +8,7 @@
8 * the Free Software Foundation version 2. 8 * the Free Software Foundation version 2.
9 */ 9 */
10 10
11#include <acpi/acpi_bus.h> 11#include <linux/acpi.h>
12#include <acpi/acpi_drivers.h>
13#include <linux/wait.h> 12#include <linux/wait.h>
14#include <linux/slab.h> 13#include <linux/slab.h>
15#include <linux/delay.h> 14#include <linux/delay.h>
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index fd39459926b1..68d40ff066fd 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -12,8 +12,6 @@
12#include <linux/dmi.h> 12#include <linux/dmi.h>
13#include <linux/nls.h> 13#include <linux/nls.h>
14 14
15#include <acpi/acpi_drivers.h>
16
17#include "internal.h" 15#include "internal.h"
18 16
19#define _COMPONENT ACPI_BUS_COMPONENT 17#define _COMPONENT ACPI_BUS_COMPONENT
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 721e949e606e..54ab26664039 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -18,12 +18,8 @@
18#include <linux/reboot.h> 18#include <linux/reboot.h>
19#include <linux/acpi.h> 19#include <linux/acpi.h>
20#include <linux/module.h> 20#include <linux/module.h>
21
22#include <asm/io.h> 21#include <asm/io.h>
23 22
24#include <acpi/acpi_bus.h>
25#include <acpi/acpi_drivers.h>
26
27#include "internal.h" 23#include "internal.h"
28#include "sleep.h" 24#include "sleep.h"
29 25
@@ -806,9 +802,6 @@ int __init acpi_sleep_init(void)
806 char *pos = supported; 802 char *pos = supported;
807 int i; 803 int i;
808 804
809 if (acpi_disabled)
810 return 0;
811
812 acpi_sleep_dmi_check(); 805 acpi_sleep_dmi_check();
813 806
814 sleep_states[ACPI_STATE_S0] = 1; 807 sleep_states[ACPI_STATE_S0] = 1;
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index 6dbc3ca45223..443dc9366052 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -5,7 +5,7 @@
5#include <linux/init.h> 5#include <linux/init.h>
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/moduleparam.h> 7#include <linux/moduleparam.h>
8#include <acpi/acpi_drivers.h> 8#include <linux/acpi.h>
9 9
10#include "internal.h" 10#include "internal.h"
11 11
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index d67a1fe07f0e..5837f857ac2e 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -278,12 +278,13 @@ acpi_table_parse_madt(enum acpi_madt_type id,
278 278
279/** 279/**
280 * acpi_table_parse - find table with @id, run @handler on it 280 * acpi_table_parse - find table with @id, run @handler on it
281 *
282 * @id: table id to find 281 * @id: table id to find
283 * @handler: handler to run 282 * @handler: handler to run
284 * 283 *
285 * Scan the ACPI System Descriptor Table (STD) for a table matching @id, 284 * Scan the ACPI System Descriptor Table (STD) for a table matching @id,
286 * run @handler on it. Return 0 if table found, return on if not. 285 * run @handler on it.
286 *
287 * Return 0 if table found, -errno if not.
287 */ 288 */
288int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler) 289int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
289{ 290{
@@ -293,7 +294,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
293 if (acpi_disabled) 294 if (acpi_disabled)
294 return -ENODEV; 295 return -ENODEV;
295 296
296 if (!handler) 297 if (!id || !handler)
297 return -EINVAL; 298 return -EINVAL;
298 299
299 if (strncmp(id, ACPI_SIG_MADT, 4) == 0) 300 if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
@@ -306,7 +307,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
306 early_acpi_os_unmap_memory(table, tbl_size); 307 early_acpi_os_unmap_memory(table, tbl_size);
307 return 0; 308 return 0;
308 } else 309 } else
309 return 1; 310 return -ENODEV;
310} 311}
311 312
312/* 313/*
@@ -351,7 +352,7 @@ int __init acpi_table_init(void)
351 352
352 status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); 353 status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
353 if (ACPI_FAILURE(status)) 354 if (ACPI_FAILURE(status))
354 return 1; 355 return -EINVAL;
355 356
356 check_multiple_madt(); 357 check_multiple_madt();
357 return 0; 358 return 0;
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 0d9f46b5ae6d..1fd21ad69c98 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -41,10 +41,9 @@
41#include <linux/kmod.h> 41#include <linux/kmod.h>
42#include <linux/reboot.h> 42#include <linux/reboot.h>
43#include <linux/device.h> 43#include <linux/device.h>
44#include <asm/uaccess.h>
45#include <linux/thermal.h> 44#include <linux/thermal.h>
46#include <acpi/acpi_bus.h> 45#include <linux/acpi.h>
47#include <acpi/acpi_drivers.h> 46#include <asm/uaccess.h>
48 47
49#define PREFIX "ACPI: " 48#define PREFIX "ACPI: "
50 49
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 6d408bfbbb1d..1336b9151479 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -30,8 +30,6 @@
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/hardirq.h> 31#include <linux/hardirq.h>
32#include <linux/acpi.h> 32#include <linux/acpi.h>
33#include <acpi/acpi_bus.h>
34#include <acpi/acpi_drivers.h>
35 33
36#include "internal.h" 34#include "internal.h"
37 35
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 995e91bcb97b..b727d105046d 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -37,12 +37,11 @@
37#include <linux/pci.h> 37#include <linux/pci.h>
38#include <linux/pci_ids.h> 38#include <linux/pci_ids.h>
39#include <linux/slab.h> 39#include <linux/slab.h>
40#include <asm/uaccess.h>
41#include <linux/dmi.h> 40#include <linux/dmi.h>
42#include <acpi/acpi_bus.h>
43#include <acpi/acpi_drivers.h>
44#include <linux/suspend.h> 41#include <linux/suspend.h>
42#include <linux/acpi.h>
45#include <acpi/video.h> 43#include <acpi/video.h>
44#include <asm/uaccess.h>
46 45
47#include "internal.h" 46#include "internal.h"
48 47
diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c
index 7bfbe40bc43b..1638401ab282 100644
--- a/drivers/acpi/wakeup.c
+++ b/drivers/acpi/wakeup.c
@@ -5,7 +5,6 @@
5 5
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/acpi.h> 7#include <linux/acpi.h>
8#include <acpi/acpi_drivers.h>
9#include <linux/kernel.h> 8#include <linux/kernel.h>
10#include <linux/types.h> 9#include <linux/types.h>
11 10