[PARISC] Clean up asm-parisc/serial.h
[powerpc.git] / drivers / serial / mpc52xx_uart.c
index 1aa3484..dbad0e3 100644 (file)
@@ -44,7 +44,6 @@
  * will be mapped to.
  */
 
-#include <linux/config.h>
 #include <linux/platform_device.h>
 #include <linux/module.h>
 #include <linux/tty.h>
@@ -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
@@ -727,8 +735,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 );