X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fserial%2Fmpc52xx_uart.c;h=4f80c5b4a7533590ad6a51a22708d868fb43fdec;hb=470ea7eba4aaa517533f9b02ac9a104e77264548;hp=6459edc7f5c5e09d23bef78c590abfe677a5a813;hpb=36ddf5bbdea7ba4582abc62f106f0f0e9f0b6b91;p=~andy%2Flinux diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 6459edc7f5c..4f80c5b4a75 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -44,7 +44,6 @@ * will be mapped to. */ -#include #include #include #include @@ -86,7 +85,7 @@ static struct uart_port mpc52xx_uart_ports[MPC52xx_PSC_MAXNUM]; /* Forward declaration of the interruption handling routine */ -static irqreturn_t mpc52xx_uart_int(int irq,void *dev_id,struct pt_regs *regs); +static irqreturn_t mpc52xx_uart_int(int irq,void *dev_id); /* Simple macro to test if a port is console or not. This one is taken @@ -191,7 +190,7 @@ mpc52xx_uart_startup(struct uart_port *port) /* Request IRQ */ ret = request_irq(port->irq, mpc52xx_uart_int, - SA_INTERRUPT | SA_SAMPLE_RANDOM, "mpc52xx_psc_uart", port); + IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "mpc52xx_psc_uart", port); if (ret) return ret; @@ -339,14 +338,23 @@ mpc52xx_uart_release_port(struct uart_port *port) static int mpc52xx_uart_request_port(struct uart_port *port) { + int err; + if (port->flags & UPF_IOREMAP) /* Need to remap ? */ port->membase = ioremap(port->mapbase, MPC52xx_PSC_SIZE); if (!port->membase) return -EINVAL; - return request_mem_region(port->mapbase, MPC52xx_PSC_SIZE, + err = request_mem_region(port->mapbase, MPC52xx_PSC_SIZE, "mpc52xx_psc_uart") != NULL ? 0 : -EBUSY; + + if (err && (port->flags & UPF_IOREMAP)) { + iounmap(port->membase); + port->membase = NULL; + } + + return err; } static void @@ -402,7 +410,7 @@ static struct uart_ops mpc52xx_uart_ops = { /* ======================================================================== */ static inline int -mpc52xx_uart_int_rx_chars(struct uart_port *port, struct pt_regs *regs) +mpc52xx_uart_int_rx_chars(struct uart_port *port) { struct tty_struct *tty = port->info->tty; unsigned char ch, flag; @@ -417,7 +425,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port, struct pt_regs *regs) /* Handle sysreq char */ #ifdef SUPPORT_SYSRQ - if (uart_handle_sysrq_char(port, ch, regs)) { + if (uart_handle_sysrq_char(port, ch)) { port->sysrq = 0; continue; } @@ -502,21 +510,13 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port) } static irqreturn_t -mpc52xx_uart_int(int irq, void *dev_id, struct pt_regs *regs) +mpc52xx_uart_int(int irq, void *dev_id) { - struct uart_port *port = (struct uart_port *) dev_id; + struct uart_port *port = dev_id; unsigned long pass = ISR_PASS_LIMIT; unsigned int keepgoing; unsigned short status; - if ( irq != port->irq ) { - printk( KERN_WARNING - "mpc52xx_uart_int : " \ - "Received wrong int %d. Waiting for %d\n", - irq, port->irq); - return IRQ_NONE; - } - spin_lock(&port->lock); /* While we have stuff to do, we continue */ @@ -531,7 +531,7 @@ mpc52xx_uart_int(int irq, void *dev_id, struct pt_regs *regs) /* Do we need to receive chars ? */ /* For this RX interrupts must be on and some chars waiting */ if ( status & MPC52xx_PSC_IMR_RXRDY ) - keepgoing |= mpc52xx_uart_int_rx_chars(port, regs); + keepgoing |= mpc52xx_uart_int_rx_chars(port); /* Do we need to send chars ? */ /* For this, TX must be ready and TX interrupt enabled */ @@ -693,7 +693,6 @@ static struct uart_driver mpc52xx_uart_driver = { .owner = THIS_MODULE, .driver_name = "mpc52xx_psc_uart", .dev_name = "ttyPSC", - .devfs_name = "ttyPSC", .major = SERIAL_PSC_MAJOR, .minor = SERIAL_PSC_MINOR, .nr = MPC52xx_PSC_MAXNUM, @@ -728,8 +727,7 @@ mpc52xx_uart_probe(struct platform_device *dev) spin_lock_init(&port->lock); port->uartclk = __res.bi_ipbfreq / 2; /* Look at CTLR doc */ - port->fifosize = 255; /* Should be 512 ! But it can't be */ - /* stored in a unsigned char */ + port->fifosize = 512; port->iotype = UPIO_MEM; port->flags = UPF_BOOT_AUTOCONF | ( uart_console(port) ? 0 : UPF_IOREMAP );