]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
io_edgeport: Fix various bogus returns to the tty layer
authorAlan Cox <alan@redhat.com>
Tue, 22 Jul 2008 10:16:42 +0000 (11:16 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Jul 2008 20:03:27 +0000 (13:03 -0700)
The edgeport reports negative error codes to functions that do not
expect them. This can cause ports to jam forever

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/usb/serial/io_edgeport.c

index b4bd6847a96d81d3968d870c2a6b5af15e2c0071..bfa508ddb0fed3f97062bf66e16326b765dbcbe1 100644 (file)
@@ -1404,15 +1404,15 @@ static int edge_write_room(struct tty_struct *tty)
        dbg("%s", __func__);
 
        if (edge_port == NULL)
-               return -ENODEV;
+               return 0;
        if (edge_port->closePending)
-               return -ENODEV;
+               return 0;
 
        dbg("%s - port %d", __func__, port->number);
 
        if (!edge_port->open) {
                dbg("%s - port not opened", __func__);
-               return -EINVAL;
+               return 0;
        }
 
        /* total of both buffers is still txCredit */
@@ -1444,13 +1444,13 @@ static int edge_chars_in_buffer(struct tty_struct *tty)
        dbg("%s", __func__);
 
        if (edge_port == NULL)
-               return -ENODEV;
+               return 0;
        if (edge_port->closePending)
-               return -ENODEV;
+               return 0;
 
        if (!edge_port->open) {
                dbg("%s - port not opened", __func__);
-               return -EINVAL;
+               return 0;
        }
 
        spin_lock_irqsave(&edge_port->ep_lock, flags);