]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/generic_serial.c
autofs4: check for invalid dentry in getpath
[linux-2.6-omap-h63xx.git] / drivers / char / generic_serial.c
index 8facf3e25c490f75773a857a012e66a968469654..252f73e4859664b79bcb32657445265d943c10bb 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/interrupt.h>
 #include <linux/tty_flip.h>
 #include <linux/delay.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #define DEBUG 
@@ -41,27 +40,27 @@ static int gs_debug;
 #define gs_dprintk(f, str...) /* nothing */
 #endif
 
-#define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __FUNCTION__)
-#define func_exit()  gs_dprintk (GS_DEBUG_FLOW, "gs: exit  %s\n", __FUNCTION__)
+#define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __func__)
+#define func_exit()  gs_dprintk (GS_DEBUG_FLOW, "gs: exit  %s\n", __func__)
 
 #define RS_EVENT_WRITE_WAKEUP  1
 
 module_param(gs_debug, int, 0644);
 
 
-void gs_put_char(struct tty_struct * tty, unsigned char ch)
+int gs_put_char(struct tty_struct * tty, unsigned char ch)
 {
        struct gs_port *port;
 
        func_enter (); 
 
-       if (!tty) return;
+       if (!tty) return 0;
 
        port = tty->driver_data;
 
-       if (!port) return;
+       if (!port) return 0;
 
-       if (! (port->flags & ASYNC_INITIALIZED)) return;
+       if (! (port->flags & ASYNC_INITIALIZED)) return 0;
 
        /* Take a lock on the serial tranmit buffer! */
        mutex_lock(& port->port_write_mutex);
@@ -69,7 +68,7 @@ void gs_put_char(struct tty_struct * tty, unsigned char ch)
        if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) {
                /* Sorry, buffer is full, drop character. Update statistics???? -- REW */
                mutex_unlock(&port->port_write_mutex);
-               return;
+               return 0;
        }
 
        port->xmit_buf[port->xmit_head++] = ch;
@@ -78,6 +77,7 @@ void gs_put_char(struct tty_struct * tty, unsigned char ch)
 
        mutex_unlock(&port->port_write_mutex);
        func_exit ();
+       return 1;
 }
 
 
@@ -587,8 +587,7 @@ void gs_close(struct tty_struct * tty, struct file * filp)
 
        port->flags &= ~GS_ACTIVE;
 
-       if (tty->driver->flush_buffer)
-               tty->driver->flush_buffer(tty);
+       gs_flush_buffer(tty);
 
        tty_ldisc_flush(tty);
        tty->closing = 0;