b/drivers/acpi/acpi_memhotplug.c
@@ -529,9 +529,12 @@ static int __init acpi_memory_device_init(void)
int result;
acpi_status status;
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
result = acpi_bus_register_driver(&acpi_memory_device_driver);
-
if (result < 0)
return -ENODEV;
@@ -539,7 +542,6 @@ static int __init acpi_memory_device_init(void)
ACPI_UINT32_MAX,
acpi_memory_register_notify_handler,
NULL, NULL);
-
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
acpi_bus_unregister_driver(&acpi_memory_device_driver);
@@ -495,6 +495,11 @@ static struct acpi_driver acpi_pad_driver = {
static int __init acpi_pad_init(void)
{
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
+
power_saving_mwait_init();
if (power_saving_mwait_eax == 0)
return -EINVAL;
@@ -456,13 +456,22 @@ static int __init acpi_button_init(void)
{
int result;
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
+
+#ifdef CONFIG_ACPI_PROCFS
acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
if (!acpi_button_dir)
return -ENODEV;
+#endif
result = acpi_bus_register_driver(&acpi_button_driver);
if (result < 0) {
+#ifdef CONFIG_ACPI_PROCFS
remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
+#endif
return -ENODEV;
}
@@ -249,6 +249,11 @@ static int __init acpi_container_init(void)
int result = 0;
int action = INSTALL_NOTIFY_HANDLER;
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
+
result = acpi_bus_register_driver(&acpi_container_driver);
if (result < 0) {
return (result);
@@ -347,6 +347,10 @@ static int __init acpi_fan_init(void)
{
int result = 0;
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
#ifdef CONFIG_ACPI_PROCFS
acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
@@ -356,7 +360,9 @@ static int __init acpi_fan_init(void)
result = acpi_bus_register_driver(&acpi_fan_driver);
if (result < 0) {
+#ifdef CONFIG_ACPI_PROCFS
remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
+#endif
return -ENODEV;
}
@@ -355,7 +355,12 @@ static struct dmi_system_id
acpi_pci_slot_dmi_table[] __initdata = {
static int __init
acpi_pci_slot_init(void)
-{
+{
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
+
dmi_check_system(acpi_pci_slot_dmi_table);
acpi_pci_register_driver(&acpi_pci_slot_driver);
return 0;
@@ -312,6 +312,11 @@ static int __init acpi_smb_hc_init(void)
{
int result;
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
+
result = acpi_bus_register_driver(&acpi_smb_hc_driver);
if (result < 0)
return -ENODEV;
@@ -1534,19 +1534,29 @@ static int __init acpi_thermal_init(void)
{
int result = 0;
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
+
dmi_check_system(thermal_dmi_table);
if (off) {
printk(KERN_NOTICE "ACPI: thermal control disabled\n");
return -ENODEV;
}
+
+#ifdef CONFIG_ACPI_PROCFS
acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir);
if (!acpi_thermal_dir)
return -ENODEV;
+#endif
result = acpi_bus_register_driver(&acpi_thermal_driver);
if (result < 0) {
+#ifdef CONFIG_ACPI_PROCFS
remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir);
+#endif
return -ENODEV;
}
@@ -2379,13 +2379,17 @@ int acpi_video_register(void)
return 0;
}
+#ifdef CONFIG_ACPI_PROCFS
acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir);
if (!acpi_video_dir)
return -ENODEV;
+#endif
result = acpi_bus_register_driver(&acpi_video_bus);
if (result < 0) {
+#ifdef CONFIG_ACPI_PROCFS
remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir);
+#endif
return -ENODEV;
}
@@ -2427,6 +2431,11 @@ EXPORT_SYMBOL(acpi_video_unregister);
static int __init acpi_video_init(void)
{
+ if (acpi_disabled) {
+ printk(KERN_ERR AE_INFO ": ACPI is disabled.\n");
+ return -ENODEV;
+ }
+
dmi_check_system(video_dmi_table);
if (intel_opregion_present())