X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fserial%2Fmpc52xx_uart.c;h=dbad0e31e005864cb02c72b9f293ecbc11e906d5;hb=136ce40e9f1f24ca1dbf7714c669a7bca56440ea;hp=48eb22d3a63e32475af487955f3ac335146b1602;hpb=c4e00fac42f268ed0a547cdd1d12bb8399864040;p=powerpc.git diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 48eb22d3a6..dbad0e31e0 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -338,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 @@ -726,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 );