Skip to content

Commit

Permalink
[ARM] S3C: Update CONFIG_SERIAL_SAMSUNG_UARTS handling
Browse files Browse the repository at this point in the history
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 <ben-linux@fluff.org>
  • Loading branch information
Ben Dooks committed Dec 18, 2008
1 parent 03d5e77 commit bdd4915
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/arm/plat-s3c/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
9 changes: 6 additions & 3 deletions drivers/serial/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bdd4915

Please sign in to comment.