[PATCH] devfs: Remove the devfs_fs_kernel.h file from the tree
[safe/jmp/linux-2.6] / drivers / char / misc.c
index 3115d31..f1fdd84 100644 (file)
@@ -44,7 +44,6 @@
 #include <linux/slab.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/stat.h>
 #include <linux/init.h>
 #include <linux/device.h>
@@ -63,11 +62,7 @@ static DECLARE_MUTEX(misc_sem);
 #define DYNAMIC_MINORS 64 /* like dynamic majors */
 static unsigned char misc_minors[DYNAMIC_MINORS / 8];
 
-extern int rtc_DP8570A_init(void);
-extern int rtc_MK48T08_init(void);
 extern int pmu_device_init(void);
-extern int tosh_init(void);
-extern int i8k_init(void);
 
 #ifdef CONFIG_PROC_FS
 static void *misc_seq_start(struct seq_file *seq, loff_t *pos)
@@ -133,7 +128,7 @@ static int misc_open(struct inode * inode, struct file * file)
        int minor = iminor(inode);
        struct miscdevice *c;
        int err = -ENODEV;
-       struct file_operations *old_fops, *new_fops = NULL;
+       const struct file_operations *old_fops, *new_fops = NULL;
        
        down(&misc_sem);
        
@@ -208,7 +203,7 @@ int misc_register(struct miscdevice * misc)
 {
        struct miscdevice *c;
        dev_t dev;
-       int err;
+       int err = 0;
 
        down(&misc_sem);
        list_for_each_entry(c, &misc_list, list) {
@@ -238,20 +233,13 @@ int misc_register(struct miscdevice * misc)
        }
        dev = MKDEV(MISC_MAJOR, misc->minor);
 
-       misc->class = class_device_create(misc_class, dev, misc->dev,
+       misc->class = class_device_create(misc_class, NULL, dev, misc->dev,
                                          "%s", misc->name);
        if (IS_ERR(misc->class)) {
                err = PTR_ERR(misc->class);
                goto out;
        }
 
-       err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, 
-                           misc->devfs_name);
-       if (err) {
-               class_device_destroy(misc_class, dev);
-               goto out;
-       }
-
        /*
         * Add it to the front, so that later devices can "override"
         * earlier defaults
@@ -282,7 +270,6 @@ int misc_deregister(struct miscdevice * misc)
        down(&misc_sem);
        list_del(&misc->list);
        class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
-       devfs_remove(misc->devfs_name);
        if (i < DYNAMIC_MINORS && i>0) {
                misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
        }
@@ -305,21 +292,7 @@ static int __init misc_init(void)
        misc_class = class_create(THIS_MODULE, "misc");
        if (IS_ERR(misc_class))
                return PTR_ERR(misc_class);
-#ifdef CONFIG_MVME16x
-       rtc_MK48T08_init();
-#endif
-#ifdef CONFIG_BVME6000
-       rtc_DP8570A_init();
-#endif
-#ifdef CONFIG_PMAC_PBOOK
-       pmu_device_init();
-#endif
-#ifdef CONFIG_TOSHIBA
-       tosh_init();
-#endif
-#ifdef CONFIG_I8K
-       i8k_init();
-#endif
+
        if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
                printk("unable to get major %d for misc devices\n",
                       MISC_MAJOR);