Commit 9a38f4ee authored by Len Brown's avatar Len Brown

Merge branch 'bjorn-initcall-cleanup' into release

parents 67dc0921 018f452e
...@@ -32,10 +32,8 @@ ifdef CONFIG_CPU_FREQ ...@@ -32,10 +32,8 @@ ifdef CONFIG_CPU_FREQ
processor-objs += processor_perflib.o processor-objs += processor_perflib.o
endif endif
obj-y += bus.o glue.o obj-y += bus.o glue.o scan.o ec.o \
obj-y += scan.o power.o system.o event.o
# Keep EC driver first. Initialization of others depend on it.
obj-y += ec.o
obj-$(CONFIG_ACPI_AC) += ac.o obj-$(CONFIG_ACPI_AC) += ac.o
obj-$(CONFIG_ACPI_BATTERY) += battery.o obj-$(CONFIG_ACPI_BATTERY) += battery.o
obj-$(CONFIG_ACPI_BUTTON) += button.o obj-$(CONFIG_ACPI_BUTTON) += button.o
...@@ -51,8 +49,6 @@ obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o ...@@ -51,8 +49,6 @@ obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
obj-$(CONFIG_ACPI_CONTAINER) += container.o obj-$(CONFIG_ACPI_CONTAINER) += container.o
obj-$(CONFIG_ACPI_THERMAL) += thermal.o obj-$(CONFIG_ACPI_THERMAL) += thermal.o
obj-y += power.o
obj-y += system.o event.o
obj-$(CONFIG_ACPI_DEBUG) += debug.o obj-$(CONFIG_ACPI_DEBUG) += debug.o
obj-$(CONFIG_ACPI_NUMA) += numa.o obj-$(CONFIG_ACPI_NUMA) += numa.o
obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include "internal.h"
#define _COMPONENT ACPI_BUS_COMPONENT #define _COMPONENT ACPI_BUS_COMPONENT
ACPI_MODULE_NAME("bus"); ACPI_MODULE_NAME("bus");
...@@ -846,6 +848,7 @@ static int __init acpi_init(void) ...@@ -846,6 +848,7 @@ static int __init acpi_init(void)
acpi_kobj = NULL; acpi_kobj = NULL;
} }
init_acpi_device_notify();
result = acpi_bus_init(); result = acpi_bus_init();
if (!result) { if (!result) {
...@@ -860,11 +863,23 @@ static int __init acpi_init(void) ...@@ -860,11 +863,23 @@ static int __init acpi_init(void)
} }
} else } else
disable_acpi(); disable_acpi();
if (acpi_disabled)
return result;
/* /*
* If the laptop falls into the DMI check table, the power state check * If the laptop falls into the DMI check table, the power state check
* will be disabled in the course of device power transistion. * will be disabled in the course of device power transistion.
*/ */
dmi_check_system(power_nocheck_dmi_table); dmi_check_system(power_nocheck_dmi_table);
acpi_scan_init();
acpi_ec_init();
acpi_power_init();
acpi_system_init();
acpi_debug_init();
acpi_sleep_proc_init();
acpi_wakeup_device_init();
return result; return result;
} }
......
...@@ -297,17 +297,15 @@ acpi_system_write_debug(struct file *file, ...@@ -297,17 +297,15 @@ acpi_system_write_debug(struct file *file,
return count; return count;
} }
#endif
static int __init acpi_debug_init(void) int __init acpi_debug_init(void)
{ {
#ifdef CONFIG_ACPI_PROCFS
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
int error = 0; int error = 0;
char *name; char *name;
if (acpi_disabled)
return 0;
/* 'debug_layer' [R/W] */ /* 'debug_layer' [R/W] */
name = ACPI_SYSTEM_FILE_DEBUG_LAYER; name = ACPI_SYSTEM_FILE_DEBUG_LAYER;
entry = entry =
...@@ -338,7 +336,7 @@ static int __init acpi_debug_init(void) ...@@ -338,7 +336,7 @@ static int __init acpi_debug_init(void)
remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir);
error = -ENODEV; error = -ENODEV;
goto Done; goto Done;
} #else
return 0;
subsys_initcall(acpi_debug_init);
#endif #endif
}
...@@ -1069,13 +1069,10 @@ static struct acpi_driver acpi_ec_driver = { ...@@ -1069,13 +1069,10 @@ static struct acpi_driver acpi_ec_driver = {
}, },
}; };
static int __init acpi_ec_init(void) int __init acpi_ec_init(void)
{ {
int result = 0; int result = 0;
if (acpi_disabled)
return 0;
acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir); acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir);
if (!acpi_ec_dir) if (!acpi_ec_dir)
return -ENODEV; return -ENODEV;
...@@ -1090,8 +1087,6 @@ static int __init acpi_ec_init(void) ...@@ -1090,8 +1087,6 @@ static int __init acpi_ec_init(void)
return result; return result;
} }
subsys_initcall(acpi_ec_init);
/* EC driver currently not unloadable */ /* EC driver currently not unloadable */
#if 0 #if 0
static void __exit acpi_ec_exit(void) static void __exit acpi_ec_exit(void)
......
...@@ -286,10 +286,8 @@ static int acpi_platform_notify_remove(struct device *dev) ...@@ -286,10 +286,8 @@ static int acpi_platform_notify_remove(struct device *dev)
return 0; return 0;
} }
static int __init init_acpi_device_notify(void) int __init init_acpi_device_notify(void)
{ {
if (acpi_disabled)
return 0;
if (platform_notify || platform_notify_remove) { if (platform_notify || platform_notify_remove) {
printk(KERN_ERR PREFIX "Can't use platform_notify\n"); printk(KERN_ERR PREFIX "Can't use platform_notify\n");
return 0; return 0;
...@@ -298,5 +296,3 @@ static int __init init_acpi_device_notify(void) ...@@ -298,5 +296,3 @@ static int __init init_acpi_device_notify(void)
platform_notify_remove = acpi_platform_notify_remove; platform_notify_remove = acpi_platform_notify_remove;
return 0; return 0;
} }
arch_initcall(init_acpi_device_notify);
/* For use by Linux/ACPI infrastructure, not drivers */
int init_acpi_device_notify(void);
int acpi_scan_init(void);
int acpi_system_init(void);
#ifdef CONFIG_ACPI_DEBUG
int acpi_debug_init(void);
#else
static inline int acpi_debug_init(void) { return 0; }
#endif
/* --------------------------------------------------------------------------
Power Resource
-------------------------------------------------------------------------- */
int acpi_power_init(void);
int acpi_device_sleep_wake(struct acpi_device *dev,
int enable, int sleep_state, int dev_state);
int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state);
int acpi_disable_wakeup_device_power(struct acpi_device *dev);
int acpi_power_get_inferred_state(struct acpi_device *device);
int acpi_power_transition(struct acpi_device *device, int state);
extern int acpi_power_nocheck;
int acpi_wakeup_device_init(void);
/* --------------------------------------------------------------------------
Embedded Controller
-------------------------------------------------------------------------- */
int acpi_ec_init(void);
int acpi_ec_ecdt_probe(void);
int acpi_boot_ec_enable(void);
/*--------------------------------------------------------------------------
Suspend/Resume
-------------------------------------------------------------------------- */
extern int acpi_sleep_init(void);
#ifdef CONFIG_ACPI_SLEEP
int acpi_sleep_proc_init(void);
#else
static inline int acpi_sleep_proc_init(void) { return 0; }
#endif
...@@ -773,14 +773,10 @@ static int acpi_power_resume(struct acpi_device *device) ...@@ -773,14 +773,10 @@ static int acpi_power_resume(struct acpi_device *device)
return 0; return 0;
} }
static int __init acpi_power_init(void) int __init acpi_power_init(void)
{ {
int result = 0; int result = 0;
if (acpi_disabled)
return 0;
INIT_LIST_HEAD(&acpi_power_resource_list); INIT_LIST_HEAD(&acpi_power_resource_list);
acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir); acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir);
...@@ -795,5 +791,3 @@ static int __init acpi_power_init(void) ...@@ -795,5 +791,3 @@ static int __init acpi_power_init(void)
return 0; return 0;
} }
subsys_initcall(acpi_power_init);
...@@ -496,11 +496,8 @@ static u32 rtc_handler(void *context) ...@@ -496,11 +496,8 @@ static u32 rtc_handler(void *context)
} }
#endif /* HAVE_ACPI_LEGACY_ALARM */ #endif /* HAVE_ACPI_LEGACY_ALARM */
static int __init acpi_sleep_proc_init(void) int __init acpi_sleep_proc_init(void)
{ {
if (acpi_disabled)
return 0;
#ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS
/* 'sleep' [R/W] */ /* 'sleep' [R/W] */
proc_create("sleep", S_IFREG | S_IRUGO | S_IWUSR, proc_create("sleep", S_IFREG | S_IRUGO | S_IWUSR,
...@@ -527,5 +524,3 @@ static int __init acpi_sleep_proc_init(void) ...@@ -527,5 +524,3 @@ static int __init acpi_sleep_proc_init(void)
return 0; return 0;
} }
late_initcall(acpi_sleep_proc_init);
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include "internal.h"
#define _COMPONENT ACPI_BUS_COMPONENT #define _COMPONENT ACPI_BUS_COMPONENT
ACPI_MODULE_NAME("scan"); ACPI_MODULE_NAME("scan");
#define STRUCT_TO_INT(s) (*((int*)&s)) #define STRUCT_TO_INT(s) (*((int*)&s))
...@@ -1524,16 +1526,11 @@ static int acpi_bus_scan_fixed(struct acpi_device *root) ...@@ -1524,16 +1526,11 @@ static int acpi_bus_scan_fixed(struct acpi_device *root)
return result; return result;
} }
int __init acpi_scan_init(void)
static int __init acpi_scan_init(void)
{ {
int result; int result;
struct acpi_bus_ops ops; struct acpi_bus_ops ops;
if (acpi_disabled)
return 0;
memset(&ops, 0, sizeof(ops)); memset(&ops, 0, sizeof(ops));
ops.acpi_op_add = 1; ops.acpi_op_add = 1;
ops.acpi_op_start = 1; ops.acpi_op_start = 1;
...@@ -1566,5 +1563,3 @@ static int __init acpi_scan_init(void) ...@@ -1566,5 +1563,3 @@ static int __init acpi_scan_init(void)
Done: Done:
return result; return result;
} }
subsys_initcall(acpi_scan_init);
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include "internal.h"
#include "sleep.h" #include "sleep.h"
u8 sleep_states[ACPI_S_STATE_COUNT]; u8 sleep_states[ACPI_S_STATE_COUNT];
......
...@@ -571,12 +571,9 @@ static int acpi_system_procfs_init(void) ...@@ -571,12 +571,9 @@ static int acpi_system_procfs_init(void)
} }
#endif #endif
static int __init acpi_system_init(void) int __init acpi_system_init(void)
{ {
int result = 0; int result;
if (acpi_disabled)
return 0;
result = acpi_system_procfs_init(); result = acpi_system_procfs_init();
if (result) if (result)
...@@ -586,5 +583,3 @@ static int __init acpi_system_init(void) ...@@ -586,5 +583,3 @@ static int __init acpi_system_init(void)
return result; return result;
} }
subsys_initcall(acpi_system_init);
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include "internal.h"
#include "sleep.h" #include "sleep.h"
#define _COMPONENT ACPI_SYSTEM_COMPONENT #define _COMPONENT ACPI_SYSTEM_COMPONENT
...@@ -136,13 +138,10 @@ void acpi_disable_wakeup_device(u8 sleep_state) ...@@ -136,13 +138,10 @@ void acpi_disable_wakeup_device(u8 sleep_state)
spin_unlock(&acpi_device_lock); spin_unlock(&acpi_device_lock);
} }
static int __init acpi_wakeup_device_init(void) int __init acpi_wakeup_device_init(void)
{ {
struct list_head *node, *next; struct list_head *node, *next;
if (acpi_disabled)
return 0;
spin_lock(&acpi_device_lock); spin_lock(&acpi_device_lock);
list_for_each_safe(node, next, &acpi_wakeup_device_list) { list_for_each_safe(node, next, &acpi_wakeup_device_list) {
struct acpi_device *dev = container_of(node, struct acpi_device *dev = container_of(node,
...@@ -163,5 +162,3 @@ static int __init acpi_wakeup_device_init(void) ...@@ -163,5 +162,3 @@ static int __init acpi_wakeup_device_init(void)
spin_unlock(&acpi_device_lock); spin_unlock(&acpi_device_lock);
return 0; return 0;
} }
late_initcall(acpi_wakeup_device_init);
...@@ -98,24 +98,6 @@ int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id, ...@@ -98,24 +98,6 @@ int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id,
struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain,
int bus); int bus);
/* --------------------------------------------------------------------------
Power Resource
-------------------------------------------------------------------------- */
int acpi_device_sleep_wake(struct acpi_device *dev,
int enable, int sleep_state, int dev_state);
int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state);
int acpi_disable_wakeup_device_power(struct acpi_device *dev);
int acpi_power_get_inferred_state(struct acpi_device *device);
int acpi_power_transition(struct acpi_device *device, int state);
extern int acpi_power_nocheck;
/* --------------------------------------------------------------------------
Embedded Controller
-------------------------------------------------------------------------- */
int acpi_ec_ecdt_probe(void);
int acpi_boot_ec_enable(void);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Processor Processor
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
...@@ -165,9 +147,4 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle) ...@@ -165,9 +147,4 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle)
} }
#endif #endif
/*--------------------------------------------------------------------------
Suspend/Resume
-------------------------------------------------------------------------- */
extern int acpi_sleep_init(void);
#endif /*__ACPI_DRIVERS_H__*/ #endif /*__ACPI_DRIVERS_H__*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment