x86, 32-bit: trim memory not covered by wb mtrrs
[deliverable/linux.git] / arch / x86 / kernel / msr.c
index e18e516cf5491bf875d5fbe6a3ef42fc10e39fef..21f6e3c0be185c657d307042168fef4509073798 100644 (file)
@@ -112,7 +112,7 @@ static ssize_t msr_write(struct file *file, const char __user *buf,
 static int msr_open(struct inode *inode, struct file *file)
 {
        unsigned int cpu = iminor(file->f_path.dentry->d_inode);
-       struct cpuinfo_x86 *c = &(cpu_data)[cpu];
+       struct cpuinfo_x86 *c = &cpu_data(cpu);
 
        if (cpu >= NR_CPUS || !cpu_online(cpu))
                return -ENXIO;  /* No such CPU */
@@ -155,15 +155,15 @@ static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
 
        switch (action) {
        case CPU_UP_PREPARE:
-       case CPU_UP_PREPARE_FROZEN:
                err = msr_device_create(cpu);
                break;
        case CPU_UP_CANCELED:
-       case CPU_UP_CANCELED_FROZEN:
        case CPU_DEAD:
-       case CPU_DEAD_FROZEN:
                msr_device_destroy(cpu);
                break;
+       case CPU_UP_CANCELED_FROZEN:
+               destroy_suspended_device(msr_class, MKDEV(MSR_MAJOR, cpu));
+               break;
        }
        return err ? NOTIFY_BAD : NOTIFY_OK;
 }
This page took 0.02514 seconds and 5 git commands to generate.