Merge branch 'for-2.6.26' of git://git.kernel.dk/linux-2.6-block
[pandora-kernel.git] / drivers / char / nozomi.c
index 6d0dc5f..66a0f93 100644 (file)
@@ -73,7 +73,7 @@ do {                                                          \
        char tmp[P_BUF_SIZE];                                   \
        snprintf(tmp, sizeof(tmp), ##args);                     \
        printk(_err_flag_ "[%d] %s(): %s\n", __LINE__,          \
-               __FUNCTION__, tmp);                             \
+               __func__, tmp);                         \
 } while (0)
 
 #define DBG1(args...) D_(0x01, ##args)
@@ -438,7 +438,7 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
                        u32 size_bytes)
 {
        u32 i = 0;
-       const u32 *ptr = (__force u32 *) mem_addr_start;
+       const u32 __iomem *ptr = mem_addr_start;
        u16 *buf16;
 
        if (unlikely(!ptr || !buf))
@@ -448,11 +448,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
        switch (size_bytes) {
        case 2: /* 2 bytes */
                buf16 = (u16 *) buf;
-               *buf16 = __le16_to_cpu(readw((void __iomem *)ptr));
+               *buf16 = __le16_to_cpu(readw(ptr));
                goto out;
                break;
        case 4: /* 4 bytes */
-               *(buf) = __le32_to_cpu(readl((void __iomem *)ptr));
+               *(buf) = __le32_to_cpu(readl(ptr));
                goto out;
                break;
        }
@@ -461,11 +461,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
                if (size_bytes - i == 2) {
                        /* Handle 2 bytes in the end */
                        buf16 = (u16 *) buf;
-                       *(buf16) = __le16_to_cpu(readw((void __iomem *)ptr));
+                       *(buf16) = __le16_to_cpu(readw(ptr));
                        i += 2;
                } else {
                        /* Read 4 bytes */
-                       *(buf) = __le32_to_cpu(readl((void __iomem *)ptr));
+                       *(buf) = __le32_to_cpu(readl(ptr));
                        i += 4;
                }
                buf++;
@@ -484,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
                        u32 size_bytes)
 {
        u32 i = 0;
-       u32 *ptr = (__force u32 *) mem_addr_start;
+       u32 __iomem *ptr = mem_addr_start;
        const u16 *buf16;
 
        if (unlikely(!ptr || !buf))
@@ -494,7 +494,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
        switch (size_bytes) {
        case 2: /* 2 bytes */
                buf16 = (const u16 *)buf;
-               writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
+               writew(__cpu_to_le16(*buf16), ptr);
                return 2;
                break;
        case 1: /*
@@ -502,7 +502,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
                 * so falling through..
                 */
        case 4: /* 4 bytes */
-               writel(__cpu_to_le32(*buf), (void __iomem *)ptr);
+               writel(__cpu_to_le32(*buf), ptr);
                return 4;
                break;
        }
@@ -511,11 +511,11 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
                if (size_bytes - i == 2) {
                        /* 2 bytes */
                        buf16 = (const u16 *)buf;
-                       writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
+                       writew(__cpu_to_le16(*buf16), ptr);
                        i += 2;
                } else {
                        /* 4 bytes */
-                       writel(__cpu_to_le32(*buf), (void __iomem *)ptr);
+                       writel(__cpu_to_le32(*buf), ptr);
                        i += 4;
                }
                buf++;
@@ -1407,7 +1407,7 @@ static int __devinit nozomi_card_init(struct pci_dev *pdev,
        /* Find out what card type it is */
        nozomi_get_card_type(dc);
 
-       dc->base_addr = ioremap(start, dc->card_type);
+       dc->base_addr = ioremap_nocache(start, dc->card_type);
        if (!dc->base_addr) {
                dev_err(&pdev->dev, "Unable to map card MMIO\n");
                ret = -ENODEV;
@@ -1724,6 +1724,8 @@ static int ntty_tiocmget(struct tty_struct *tty, struct file *file)
        const struct ctrl_dl *ctrl_dl = &port->ctrl_dl;
        const struct ctrl_ul *ctrl_ul = &port->ctrl_ul;
 
+       /* Note: these could change under us but it is not clear this
+          matters if so */
        return  (ctrl_ul->RTS ? TIOCM_RTS : 0) |
                (ctrl_ul->DTR ? TIOCM_DTR : 0) |
                (ctrl_dl->DCD ? TIOCM_CAR : 0) |
@@ -1849,16 +1851,6 @@ static void ntty_throttle(struct tty_struct *tty)
        spin_unlock_irqrestore(&dc->spin_mutex, flags);
 }
 
-/* just to discard single character writes */
-static void ntty_put_char(struct tty_struct *tty, unsigned char c)
-{
-       /*
-        * card does not react correct when we write single chars
-        * to the card, so we discard them
-        */
-       DBG2("PUT CHAR Function: %c", c);
-}
-
 /* Returns number of chars in buffer, called by tty layer */
 static s32 ntty_chars_in_buffer(struct tty_struct *tty)
 {
@@ -1892,7 +1884,6 @@ static const struct tty_operations tty_ops = {
        .unthrottle = ntty_unthrottle,
        .throttle = ntty_throttle,
        .chars_in_buffer = ntty_chars_in_buffer,
-       .put_char = ntty_put_char,
        .tiocmget = ntty_tiocmget,
        .tiocmset = ntty_tiocmset,
 };