ACPICA: Add post-order callback to acpi_walk_namespace
[safe/jmp/linux-2.6] / drivers / acpi / processor_core.c
index b972107..cb4283f 100644 (file)
@@ -82,7 +82,9 @@ MODULE_LICENSE("GPL");
 
 static int acpi_processor_add(struct acpi_device *device);
 static int acpi_processor_remove(struct acpi_device *device, int type);
+#ifdef CONFIG_ACPI_PROCFS
 static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
+#endif
 static void acpi_processor_notify(struct acpi_device *device, u32 event);
 static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu);
 static int acpi_processor_handle_eject(struct acpi_processor *pr);
@@ -110,7 +112,7 @@ static struct acpi_driver acpi_processor_driver = {
 
 #define INSTALL_NOTIFY_HANDLER         1
 #define UNINSTALL_NOTIFY_HANDLER       2
-
+#ifdef CONFIG_ACPI_PROCFS
 static const struct file_operations acpi_processor_info_fops = {
        .owner = THIS_MODULE,
        .open = acpi_processor_info_open_fs,
@@ -118,6 +120,7 @@ static const struct file_operations acpi_processor_info_fops = {
        .llseek = seq_lseek,
        .release = single_release,
 };
+#endif
 
 DEFINE_PER_CPU(struct acpi_processor *, processors);
 struct acpi_processor_errata errata __read_mostly;
@@ -316,6 +319,7 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr)
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
+#ifdef CONFIG_ACPI_PROCFS
 static struct proc_dir_entry *acpi_processor_dir = NULL;
 
 static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
@@ -388,7 +392,6 @@ static int acpi_processor_add_fs(struct acpi_device *device)
                return -EIO;
        return 0;
 }
-
 static int acpi_processor_remove_fs(struct acpi_device *device)
 {
 
@@ -405,6 +408,16 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
 
        return 0;
 }
+#else
+static inline int acpi_processor_add_fs(struct acpi_device *device)
+{
+       return 0;
+}
+static inline int acpi_processor_remove_fs(struct acpi_device *device)
+{
+       return 0;
+}
+#endif
 
 /* Use the acpiid in MADT to map cpus in case of SMP */
 
@@ -757,7 +770,7 @@ static struct notifier_block acpi_cpu_notifier =
            .notifier_call = acpi_cpu_soft_notify,
 };
 
-static int acpi_processor_add(struct acpi_device *device)
+static int __cpuinit acpi_processor_add(struct acpi_device *device)
 {
        struct acpi_processor *pr = NULL;
        int result = 0;
@@ -850,13 +863,6 @@ static int acpi_processor_add(struct acpi_device *device)
                goto err_remove_sysfs;
        }
 
-       if (pr->flags.throttling) {
-               printk(KERN_INFO PREFIX "%s [%s] (supports",
-                      acpi_device_name(device), acpi_device_bid(device));
-               printk(" %d throttling states", pr->throttling.state_count);
-               printk(")\n");
-       }
-
        return 0;
 
 err_remove_sysfs:
@@ -1096,7 +1102,7 @@ void acpi_processor_install_hotplug_notify(void)
        acpi_walk_namespace(ACPI_TYPE_PROCESSOR,
                            ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX,
-                           processor_walk_namespace_cb, &action, NULL);
+                           processor_walk_namespace_cb, NULL, &action, NULL);
 #endif
        register_hotcpu_notifier(&acpi_cpu_notifier);
 }
@@ -1109,7 +1115,7 @@ void acpi_processor_uninstall_hotplug_notify(void)
        acpi_walk_namespace(ACPI_TYPE_PROCESSOR,
                            ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX,
-                           processor_walk_namespace_cb, &action, NULL);
+                           processor_walk_namespace_cb, NULL, &action, NULL);
 #endif
        unregister_hotcpu_notifier(&acpi_cpu_notifier);
 }
@@ -1134,11 +1140,11 @@ static int __init acpi_processor_init(void)
                                (struct acpi_table_header **)&madt)))
                madt = NULL;
 #endif
-
+#ifdef CONFIG_ACPI_PROCFS
        acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
        if (!acpi_processor_dir)
                return -ENOMEM;
-
+#endif
        /*
         * Check whether the system is DMI table. If yes, OSPM
         * should not use mwait for CPU-states.
@@ -1166,7 +1172,9 @@ out_cpuidle:
        cpuidle_unregister_driver(&acpi_idle_driver);
 
 out_proc:
+#ifdef CONFIG_ACPI_PROCFS
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
+#endif
 
        return result;
 }
@@ -1186,7 +1194,9 @@ static void __exit acpi_processor_exit(void)
 
        cpuidle_unregister_driver(&acpi_idle_driver);
 
+#ifdef CONFIG_ACPI_PROCFS
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
+#endif
 
        return;
 }