fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / char / dtlk.c
index 2a11c68..d4005e9 100644 (file)
@@ -62,7 +62,6 @@
 #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
@@ -95,7 +94,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 struct file_operations dtlk_fops =
+static const struct file_operations dtlk_fops =
 {
        .owner          = THIS_MODULE,
        .read           = dtlk_read,
@@ -123,7 +122,7 @@ static void dtlk_timer_tick(unsigned long data);
 static ssize_t dtlk_read(struct file *file, char __user *buf,
                         size_t count, loff_t * ppos)
 {
-       unsigned int minor = iminor(file->f_dentry->d_inode);
+       unsigned int minor = iminor(file->f_path.dentry->d_inode);
        char ch;
        int i = 0, retries;
 
@@ -175,7 +174,7 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
        }
 #endif
 
-       if (iminor(file->f_dentry->d_inode) != DTLK_MINOR)
+       if (iminor(file->f_path.dentry->d_inode) != DTLK_MINOR)
                return -EINVAL;
 
        while (1) {
@@ -198,7 +197,7 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
                                   up to 250 usec for the RDY bit to
                                   go nonzero. */
                                for (retries = 0;
-                                    retries < HZ*(loops_per_jiffy >> 3)/500;
+                                    retries < loops_per_jiffy / (4000/HZ);
                                     retries++)
                                        if (inb_p(dtlk_port_tts) &
                                            TTS_WRITABLE)
@@ -337,9 +336,6 @@ 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);
@@ -357,7 +353,6 @@ 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);
 }
 
@@ -445,7 +440,7 @@ for (i = 0; i < 10; i++)                    \
                                LOOK
                                dtlk_write_bytes("\0012I\r", 4);
                                buffer[b++] = 0;
-                               __delay(50 * (loops_per_jiffy >> 3) * HZ / 125);
+                               __delay(50 * loops_per_jiffy / (1000/HZ));
                                outb_p(0xff, dtlk_port_lpc);
                                buffer[b++] = 0;
                                LOOK
@@ -490,7 +485,7 @@ for (i = 0; i < 10; i++)                    \
                release_region(dtlk_portlist[i], DTLK_IO_EXTENT);
        }
 
-       printk(KERN_INFO "\nDoubleTalk PC - not found\n");
+       printk(KERN_INFO "DoubleTalk PC - not found\n");
        return -ENODEV;
 }