USB: cdc_acm: Fix memory leak after hangup
[safe/jmp/linux-2.6] / drivers / serial / sunzilog.c
index 90a20a1..ef693ae 100644 (file)
 #include <linux/serio.h>
 #endif
 #include <linux/init.h>
+#include <linux/of_device.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 
 #if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -328,9 +328,9 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up,
        unsigned char ch, r1, flag;
 
        tty = NULL;
-       if (up->port.info != NULL &&            /* Unopened serial console */
-           up->port.info->tty != NULL)         /* Keyboard || mouse */
-               tty = up->port.info->tty;
+       if (up->port.state != NULL &&           /* Unopened serial console */
+           up->port.state->port.tty != NULL)   /* Keyboard || mouse */
+               tty = up->port.state->port.tty;
 
        for (;;) {
 
@@ -451,7 +451,7 @@ static void sunzilog_status_handle(struct uart_sunzilog_port *up,
                        uart_handle_cts_change(&up->port,
                                               (status & CTS));
 
-               wake_up_interruptible(&up->port.info->delta_msr_wait);
+               wake_up_interruptible(&up->port.state->port.delta_msr_wait);
        }
 
        up->prev_status = status;
@@ -501,9 +501,9 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,
                return;
        }
 
-       if (up->port.info == NULL)
+       if (up->port.state == NULL)
                goto ack_tx_int;
-       xmit = &up->port.info->xmit;
+       xmit = &up->port.state->xmit;
        if (uart_circ_empty(xmit))
                goto ack_tx_int;
 
@@ -705,7 +705,7 @@ static void sunzilog_start_tx(struct uart_port *port)
                port->icount.tx++;
                port->x_char = 0;
        } else {
-               struct circ_buf *xmit = &port->info->xmit;
+               struct circ_buf *xmit = &port->state->xmit;
 
                writeb(xmit->buf[xmit->tail], &channel->data);
                ZSDELAY();
@@ -1023,7 +1023,7 @@ static struct uart_sunzilog_port *sunzilog_irq_chain;
 
 static struct uart_driver sunzilog_reg = {
        .owner          =       THIS_MODULE,
-       .driver_name    =       "ttyS",
+       .driver_name    =       "sunzilog",
        .dev_name       =       "ttyS",
        .major          =       TTY_MAJOR,
 };
@@ -1438,12 +1438,12 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
        } else {
                printk(KERN_INFO "%s: Keyboard at MMIO 0x%llx (irq = %d) "
                       "is a %s\n",
-                      op->dev.bus_id,
+                      dev_name(&op->dev),
                       (unsigned long long) up[0].port.mapbase,
                       op->irqs[0], sunzilog_type(&up[0].port));
                printk(KERN_INFO "%s: Mouse at MMIO 0x%llx (irq = %d) "
                       "is a %s\n",
-                      op->dev.bus_id,
+                      dev_name(&op->dev),
                       (unsigned long long) up[1].port.mapbase,
                       op->irqs[0], sunzilog_type(&up[1].port));
                kbm_inst++;
@@ -1480,7 +1480,7 @@ static int __devexit zs_remove(struct of_device *op)
        return 0;
 }
 
-static struct of_device_id zs_match[] = {
+static const struct of_device_id zs_match[] = {
        {
                .name = "zs",
        },