nfsd: minor nfsd_vfs_write cleanup
[safe/jmp/linux-2.6] / drivers / parport / ieee1284.c
index 5b887ba..8901ecf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: parport_ieee1284.c,v 1.4 1997/10/19 21:37:21 philip Exp $
+/*
  * IEEE-1284 implementation for parport.
  *
  * Authors: Phil Blundell <philb@gnu.org>
@@ -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)
@@ -77,7 +76,7 @@ int parport_wait_event (struct parport *port, signed long timeout)
                   semaphore. */
                return 1;
 
-       init_timer (&timer);
+       init_timer_on_stack(&timer);
        timer.expires = jiffies + timeout;
        timer.function = timeout_waiting_on_port;
        port_from_cookie[port->number % PARPORT_MAX] = port;
@@ -85,10 +84,12 @@ int parport_wait_event (struct parport *port, signed long timeout)
 
        add_timer (&timer);
        ret = down_interruptible (&port->physport->ieee1284.irq);
-       if (!del_timer (&timer) && !ret)
+       if (!del_timer_sync(&timer) && !ret)
                /* Timed out. */
                ret = 1;
 
+       destroy_timer_on_stack(&timer);
+
        return ret;
 }
 
@@ -110,7 +111,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.
@@ -198,8 +199,6 @@ int parport_wait_peripheral(struct parport *port,
        /* 40ms of slow polling. */
        deadline = jiffies + msecs_to_jiffies(40);
        while (time_before (jiffies, deadline)) {
-               int ret;
-
                if (signal_pending (current))
                        return -EINTR;
 
@@ -572,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 (void *handle)
 {
        struct parport *port = handle;
        parport_ieee1284_wakeup (port);