[CPUFREQ] powernow-k8: check space_id of _PCT registers to be FFH
[safe/jmp/linux-2.6] / arch / ia64 / kernel / salinfo.c
index a51f1d0..7053c55 100644 (file)
@@ -44,8 +44,8 @@
 #include <linux/smp.h>
 #include <linux/timer.h>
 #include <linux/vmalloc.h>
+#include <linux/semaphore.h>
 
-#include <asm/semaphore.h>
 #include <asm/sal.h>
 #include <asm/uaccess.h>
 
@@ -162,7 +162,7 @@ static DEFINE_SPINLOCK(data_saved_lock);
 /** salinfo_platform_oemdata - optional callback to decode oemdata from an error
  * record.
  * @sect_header: pointer to the start of the section to decode.
- * @oemdata: returns vmalloc area containing the decded output.
+ * @oemdata: returns vmalloc area containing the decoded output.
  * @oemdata_size: returns length of decoded output (strlen).
  *
  * Description: If user space asks for oem data to be decoded by the kernel
@@ -317,7 +317,7 @@ retry:
        }
 
        n = data->cpu_check;
-       for (i = 0; i < NR_CPUS; i++) {
+       for (i = 0; i < nr_cpu_ids; i++) {
                if (cpu_isset(n, data->cpu_event)) {
                        if (!cpu_online(n)) {
                                cpu_clear(n, data->cpu_event);
@@ -326,7 +326,7 @@ retry:
                        cpu = n;
                        break;
                }
-               if (++n == NR_CPUS)
+               if (++n == nr_cpu_ids)
                        n = 0;
        }
 
@@ -337,7 +337,7 @@ retry:
 
        /* for next read, start checking at next CPU */
        data->cpu_check = cpu;
-       if (++data->cpu_check == NR_CPUS)
+       if (++data->cpu_check == nr_cpu_ids)
                data->cpu_check = 0;
 
        snprintf(cmd, sizeof(cmd), "read %d\n", cpu);
@@ -574,7 +574,7 @@ static const struct file_operations salinfo_data_fops = {
        .write   = salinfo_log_write,
 };
 
-static int __devinit
+static int __cpuinit
 salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
 {
        unsigned int i, cpu = (unsigned long)hcpu;
@@ -582,6 +582,7 @@ salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu
        struct salinfo_data *data;
        switch (action) {
        case CPU_ONLINE:
+       case CPU_ONLINE_FROZEN:
                spin_lock_irqsave(&data_saved_lock, flags);
                for (i = 0, data = salinfo_data;
                     i < ARRAY_SIZE(salinfo_data);
@@ -592,6 +593,7 @@ salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu
                spin_unlock_irqrestore(&data_saved_lock, flags);
                break;
        case CPU_DEAD:
+       case CPU_DEAD_FROZEN:
                spin_lock_irqsave(&data_saved_lock, flags);
                for (i = 0, data = salinfo_data;
                     i < ARRAY_SIZE(salinfo_data);
@@ -613,7 +615,7 @@ salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu
        return NOTIFY_OK;
 }
 
-static struct notifier_block salinfo_cpu_notifier =
+static struct notifier_block salinfo_cpu_notifier __cpuinitdata =
 {
        .notifier_call = salinfo_cpu_callback,
        .priority = 0,
@@ -646,18 +648,16 @@ salinfo_init(void)
                if (!dir)
                        continue;
 
-               entry = create_proc_entry("event", S_IRUSR, dir);
+               entry = proc_create_data("event", S_IRUSR, dir,
+                                        &salinfo_event_fops, data);
                if (!entry)
                        continue;
-               entry->data = data;
-               entry->proc_fops = &salinfo_event_fops;
                *sdir++ = entry;
 
-               entry = create_proc_entry("data", S_IRUSR | S_IWUSR, dir);
+               entry = proc_create_data("data", S_IRUSR | S_IWUSR, dir,
+                                        &salinfo_data_fops, data);
                if (!entry)
                        continue;
-               entry->data = data;
-               entry->proc_fops = &salinfo_data_fops;
                *sdir++ = entry;
 
                /* we missed any events before now */