tty: Ldisc revamp
[linux-2.6-block.git] / drivers / char / cyclades.c
index 571e4fab5bfa83ce0f125cff330d2dc6a9d500a6..a957dbcc5a463502f45ea3d10641e77e53c591de 100644 (file)
@@ -2814,7 +2814,7 @@ static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count)
  * done stuffing characters into the driver.  If there is no room
  * in the queue, the character is ignored.
  */
-static void cy_put_char(struct tty_struct *tty, unsigned char ch)
+static int cy_put_char(struct tty_struct *tty, unsigned char ch)
 {
        struct cyclades_port *info = tty->driver_data;
        unsigned long flags;
@@ -2824,15 +2824,15 @@ static void cy_put_char(struct tty_struct *tty, unsigned char ch)
 #endif
 
        if (serial_paranoia_check(info, tty->name, "cy_put_char"))
-               return;
+               return 0;
 
        if (!info->xmit_buf)
-               return;
+               return 0;
 
        spin_lock_irqsave(&info->card->card_lock, flags);
        if (info->xmit_cnt >= (int)(SERIAL_XMIT_SIZE - 1)) {
                spin_unlock_irqrestore(&info->card->card_lock, flags);
-               return;
+               return 0;
        }
 
        info->xmit_buf[info->xmit_head++] = ch;
@@ -2841,6 +2841,7 @@ static void cy_put_char(struct tty_struct *tty, unsigned char ch)
        info->idle_stats.xmit_bytes++;
        info->idle_stats.xmit_idle = jiffies;
        spin_unlock_irqrestore(&info->card->card_lock, flags);
+       return 1;
 }                              /* cy_put_char */
 
 /*
@@ -3489,7 +3490,7 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
        struct BOARD_CTRL __iomem *board_ctrl;
        struct CH_CTRL __iomem *ch_ctrl;
 
-       if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+       if (serial_paranoia_check(info, tty->name, __func__))
                return -ENODEV;
 
        lock_kernel();
@@ -3560,7 +3561,7 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
        struct CH_CTRL __iomem *ch_ctrl;
        int retval;
 
-       if (serial_paranoia_check(info, tty->name, __FUNCTION__))
+       if (serial_paranoia_check(info, tty->name, __func__))
                return -ENODEV;
 
        card = info->card;
@@ -4667,7 +4668,7 @@ static inline int __devinit cyc_isfwstr(const char *str, unsigned int size)
        return 0;
 }
 
-static inline void __devinit cyz_fpga_copy(void __iomem *fpga, u8 *data,
+static inline void __devinit cyz_fpga_copy(void __iomem *fpga, const u8 *data,
                unsigned int size)
 {
        for (; size > 0; size--) {
@@ -4700,10 +4701,10 @@ static int __devinit __cyz_load_fw(const struct firmware *fw,
                const char *name, const u32 mailbox, void __iomem *base,
                void __iomem *fpga)
 {
-       void *ptr = fw->data;
-       struct zfile_header *h = ptr;
-       struct zfile_config *c, *cs;
-       struct zfile_block *b, *bs;
+       const void *ptr = fw->data;
+       const struct zfile_header *h = ptr;
+       const struct zfile_config *c, *cs;
+       const struct zfile_block *b, *bs;
        unsigned int a, tmp, len = fw->size;
 #define BAD_FW KERN_ERR "Bad firmware: "
        if (len < sizeof(*h)) {
@@ -5245,7 +5246,8 @@ cyclades_get_proc_info(char *buf, char **start, off_t offset, int length,
                                        HZ, info->idle_stats.recv_bytes,
                                        (cur_jifs - info->idle_stats.recv_idle)/
                                        HZ, info->idle_stats.overruns,
-                                       (long)info->tty->ldisc.num);
+                                       /* FIXME: double check locking */
+                                       (long)info->tty->ldisc.ops->num);
                        else
                                size = sprintf(buf + len, "%3d %8lu %10lu %8lu "
                                        "%10lu %8lu %9lu %6ld\n",