]> err.no Git - linux-2.6/blobdiff - drivers/char/cyclades.c
cyclades: treat firmware data as const
[linux-2.6] / drivers / char / cyclades.c
index 571e4fab5bfa83ce0f125cff330d2dc6a9d500a6..6bff9d87dc5784289ef575962cfae3479287538e 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)) {