linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / char / dtlk.c
index 5e82c3b..a229915 100644 (file)
@@ -62,6 +62,7 @@
 #include <linux/init.h>                /* for __init, module_{init,exit} */
 #include <linux/poll.h>                /* for POLLIN, etc. */
 #include <linux/dtlk.h>                /* local header file for DoubleTalk values */
+#include <linux/devfs_fs_kernel.h>
 #include <linux/smp_lock.h>
 
 #ifdef TRACING
@@ -94,7 +95,7 @@ static int dtlk_release(struct inode *, struct file *);
 static int dtlk_ioctl(struct inode *inode, struct file *file,
                      unsigned int cmd, unsigned long arg);
 
-static const struct file_operations dtlk_fops =
+static struct file_operations dtlk_fops =
 {
        .owner          = THIS_MODULE,
        .read           = dtlk_read,
@@ -336,6 +337,9 @@ static int __init dtlk_init(void)
        if (dtlk_dev_probe() == 0)
                printk(", MAJOR %d\n", dtlk_major);
 
+       devfs_mk_cdev(MKDEV(dtlk_major, DTLK_MINOR),
+                      S_IFCHR | S_IRUSR | S_IWUSR, "dtlk");
+
        init_timer(&dtlk_timer);
        dtlk_timer.function = dtlk_timer_tick;
        init_waitqueue_head(&dtlk_process_list);
@@ -353,6 +357,7 @@ static void __exit dtlk_cleanup (void)
 
        dtlk_write_tts(DTLK_CLEAR);
        unregister_chrdev(dtlk_major, "dtlk");
+       devfs_remove("dtlk");
        release_region(dtlk_port_lpc, DTLK_IO_EXTENT);
 }
 
@@ -485,7 +490,7 @@ for (i = 0; i < 10; i++)                    \
                release_region(dtlk_portlist[i], DTLK_IO_EXTENT);
        }
 
-       printk(KERN_INFO "DoubleTalk PC - not found\n");
+       printk(KERN_INFO "\nDoubleTalk PC - not found\n");
        return -ENODEV;
 }