serial: samsung: remove the use of statically remapped controller address
authorThomas Abraham <thomas.abraham@linaro.org>
Tue, 1 Jan 2013 08:21:55 +0000 (00:21 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2013 05:57:44 +0000 (21:57 -0800)
The address S3C_VA_UART is a statically ioremapped address. The driver
should not be using this. Instead, the driver should setup a mapping
during probe.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/samsung.c

index 12e5249d053e79b8d15991daf27614755c03c3bf..96ae08f34770ff6fa3eb14c05a0bf9ec70ad4b94 100644 (file)
@@ -47,7 +47,6 @@
 #include <asm/irq.h>
 
 #include <mach/hardware.h>
-#include <mach/map.h>
 
 #include <plat/regs-serial.h>
 #include <plat/clock.h>
@@ -1144,8 +1143,13 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
 
        dbg("resource %p (%lx..%lx)\n", res, res->start, res->end);
 
+       port->membase = devm_ioremap(port->dev, res->start, resource_size(res));
+       if (!port->membase) {
+               dev_err(port->dev, "failed to remap controller address\n");
+               return -EBUSY;
+       }
+
        port->mapbase = res->start;
-       port->membase = S3C_VA_UART + (res->start & 0xfffff);
        ret = platform_get_irq(platdev, 0);
        if (ret < 0)
                port->irq = 0;