From bdd4915a9f05ef6b41b51910b199f2668f20d2ef Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 3 Nov 2008 19:51:42 +0000 Subject: [ARM] S3C: Update CONFIG_SERIAL_SAMSUNG_UARTS handling Fix the usage of CONFIG_SERIAL_SAMSUNG_UARTS in several places in the kernel where it had been missed. This finishes fixing a long standing issue where S3C2443 and S3C64XX could not use the 4th UART Signed-off-by: Ben Dooks --- drivers/serial/samsung.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/serial') diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c index ec873af2610..dc7e7ebad23 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; -- cgit v1.2.3-18-g5258