trivial: fix typo "to to" in multiple files
[safe/jmp/linux-2.6] / drivers / char / dtlk.c
index 433388c..52e0658 100644 (file)
@@ -56,6 +56,7 @@
 #include <linux/errno.h>       /* for -EBUSY */
 #include <linux/ioport.h>      /* for request_region */
 #include <linux/delay.h>       /* for loops_per_jiffy */
+#include <linux/smp_lock.h>    /* cycle_kernel_lock() */
 #include <asm/io.h>            /* for inb_p, outb_p, inb, outb, etc. */
 #include <asm/uaccess.h>       /* for get_user, etc. */
 #include <linux/wait.h>                /* for wait_queue */
@@ -288,12 +289,12 @@ static int dtlk_ioctl(struct inode *inode,
        }
 }
 
-/* No BKL needed here; "dtlk_busy" is the only global resource,
-   and it is not ever set by anybody (test is broken) */
+/* Note that nobody ever sets dtlk_busy... */
 static int dtlk_open(struct inode *inode, struct file *file)
 {
        TRACE_TEXT("(dtlk_open");
 
+       cycle_kernel_lock();
        nonseekable_open(inode, file);
        switch (iminor(inode)) {
        case DTLK_MINOR:
@@ -570,7 +571,7 @@ static char dtlk_read_tts(void)
                portval = inb_p(dtlk_port_tts);
        } while ((portval & TTS_READABLE) == 0 &&
                 retries++ < DTLK_MAX_RETRIES);
-       if (retries == DTLK_MAX_RETRIES)
+       if (retries > DTLK_MAX_RETRIES)
                printk(KERN_ERR "dtlk_read_tts() timeout\n");
 
        ch = inb_p(dtlk_port_tts);      /* input from TTS port */
@@ -582,7 +583,7 @@ static char dtlk_read_tts(void)
                portval = inb_p(dtlk_port_tts);
        } while ((portval & TTS_READABLE) != 0 &&
                 retries++ < DTLK_MAX_RETRIES);
-       if (retries == DTLK_MAX_RETRIES)
+       if (retries > DTLK_MAX_RETRIES)
                printk(KERN_ERR "dtlk_read_tts() timeout\n");
 
        TRACE_RET;
@@ -639,7 +640,7 @@ static char dtlk_write_tts(char ch)
                while ((inb_p(dtlk_port_tts) & TTS_WRITABLE) == 0 &&
                       retries++ < DTLK_MAX_RETRIES)    /* DT ready? */
                        ;
-       if (retries == DTLK_MAX_RETRIES)
+       if (retries > DTLK_MAX_RETRIES)
                printk(KERN_ERR "dtlk_write_tts() timeout\n");
 
        outb_p(ch, dtlk_port_tts);      /* output to TTS port */