--- linux/arch/i386/kernel/msr.c.1 Thu May 16 21:53:13 2002 +++ linux/arch/i386/kernel/msr.c Thu May 16 22:47:26 2002 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -250,18 +251,26 @@ static struct file_operations msr_fops = int __init msr_init(void) { +#ifndef CONFIG_DEVFS_FS if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) { printk(KERN_ERR "msr: unable to get major %d for msr\n", MSR_MAJOR); return -EBUSY; } - +#else + devfs_per_cpu_register("msr", DEVFS_FL_DEFAULT, 202, 0, + S_IFCHR | S_IRUSR | S_IWUSR, &msr_fops, NULL); +#endif return 0; } void __exit msr_exit(void) { +#ifndef CONFIG_DEVFS_FS unregister_chrdev(MSR_MAJOR, "cpu/msr"); +#else + devfs_per_cpu_unregister("msr"); +#endif } module_init(msr_init); --- linux/arch/i386/kernel/cpuid.c.1 Thu May 16 22:01:31 2002 +++ linux/arch/i386/kernel/cpuid.c Thu May 16 22:47:10 2002 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -142,18 +143,26 @@ static struct file_operations cpuid_fops int __init cpuid_init(void) { +#ifndef CONFIG_DEVFS_FS if (register_chrdev(CPUID_MAJOR, "cpu/cpuid", &cpuid_fops)) { printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n", CPUID_MAJOR); return -EBUSY; } - +#else + devfs_per_cpu_register("cpuid", DEVFS_FL_DEFAULT, 203, 0, + S_IFCHR | S_IRUSR | S_IWUSR, &cpuid_fops, NULL); +#endif return 0; } void __exit cpuid_exit(void) { +#ifndef CONFIG_DEVFS_FS unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); +#else + devfs_per_cpu_unregister("cpuid"); +#endif } module_init(cpuid_init);