fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / parport / ieee1284.c
index 694bae1..5accaa7 100644 (file)
@@ -16,7 +16,6 @@
  * Various hacks, Fred Barnes <frmb2@ukc.ac.uk>, 04/2000
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/threads.h>
 #include <linux/parport.h>
@@ -61,10 +60,10 @@ static void timeout_waiting_on_port (unsigned long cookie)
  *     set to zero, it returns immediately.
  *
  *     If an interrupt occurs before the timeout period elapses, this
- *     function returns one immediately.  If it times out, it returns
- *     a value greater than zero.  An error code less than zero
- *     indicates an error (most likely a pending signal), and the
- *     calling code should finish what it's doing as soon as it can.
+ *     function returns zero immediately.  If it times out, it returns
+ *     one.  An error code less than zero indicates an error (most
+ *     likely a pending signal), and the calling code should finish
+ *     what it's doing as soon as it can.
  */
 
 int parport_wait_event (struct parport *port, signed long timeout)
@@ -110,7 +109,7 @@ int parport_wait_event (struct parport *port, signed long timeout)
  *
  *     If the status lines take on the desired values before the
  *     timeout period elapses, parport_poll_peripheral() returns zero
- *     immediately.  A zero return value greater than zero indicates
+ *     immediately.  A return value greater than zero indicates
  *     a timeout.  An error code (less than zero) indicates an error,
  *     most likely a signal that arrived, and the caller should
  *     finish what it is doing as soon as possible.
@@ -196,7 +195,7 @@ int parport_wait_peripheral(struct parport *port,
                return 1;
 
        /* 40ms of slow polling. */
-       deadline = jiffies + (HZ + 24) / 25;
+       deadline = jiffies + msecs_to_jiffies(40);
        while (time_before (jiffies, deadline)) {
                int ret;
 
@@ -205,7 +204,7 @@ int parport_wait_peripheral(struct parport *port,
 
                /* Wait for 10ms (or until an interrupt occurs if
                 * the handler is set) */
-               if ((ret = parport_wait_event (port, (HZ + 99) / 100)) < 0)
+               if ((ret = parport_wait_event (port, msecs_to_jiffies(10))) < 0)
                        return ret;
 
                status = parport_read_status (port);
@@ -216,8 +215,7 @@ int parport_wait_peripheral(struct parport *port,
                        /* parport_wait_event didn't time out, but the
                         * peripheral wasn't actually ready either.
                         * Wait for another 10ms. */
-                       __set_current_state (TASK_INTERRUPTIBLE);
-                       schedule_timeout ((HZ+ 99) / 100);
+                       schedule_timeout_interruptible(msecs_to_jiffies(10));
                }
        }
 
@@ -573,7 +571,7 @@ static int parport_ieee1284_ack_data_avail (struct parport *port)
 #endif /* IEEE1284 support */
 
 /* Handle an interrupt. */
-void parport_ieee1284_interrupt (int which, void *handle, struct pt_regs *regs)
+void parport_ieee1284_interrupt (int which, void *handle)
 {
        struct parport *port = handle;
        parport_ieee1284_wakeup (port);