summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-s3c/init.c2
-rw-r--r--drivers/serial/samsung.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/plat-s3c/init.c b/arch/arm/plat-s3c/init.c
index 85f086ee930a..da8d089f6dbc 100644
--- a/arch/arm/plat-s3c/init.c
+++ b/arch/arm/plat-s3c/init.c
@@ -91,7 +91,7 @@ void __init s3c24xx_init_clocks(int xtal)
static int nr_uarts __initdata = 0;
-static struct s3c2410_uartcfg uart_cfgs[3];
+static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
/* s3c24xx_init_uartdevs
*
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index ec873af26101..dc7e7ebad236 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -824,7 +824,7 @@ static struct uart_ops s3c24xx_serial_ops = {
static struct uart_driver s3c24xx_uart_drv = {
.owner = THIS_MODULE,
.dev_name = "s3c2410_serial",
- .nr = 3,
+ .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
.cons = S3C24XX_SERIAL_CONSOLE,
.driver_name = S3C24XX_SERIAL_NAME,
.major = S3C24XX_SERIAL_MAJOR,
@@ -1012,8 +1012,11 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
if (port->mapbase != 0)
return 0;
- if (cfg->hwport > 3)
- return -EINVAL;
+ if (cfg->hwport > CONFIG_SERIAL_SAMSUNG_UARTS) {
+ printk(KERN_ERR "%s: port %d bigger than %d\n", __func__,
+ cfg->hwport, CONFIG_SERIAL_SAMSUNG_UARTS);
+ return -ERANGE;
+ }
/* setup info for port */
port->dev = &platdev->dev;