Skip to content

Commit

Permalink
Merge tag 'tty-3.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gregkh/tty

Pull tty/serial driver fixes from Greg Kroah-Hartman:
 "Here are some small bugfixes, and one revert, of serial driver issues
  that have been reported"

* tag 'tty-3.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  Revert "serial: 8250: Make SERIAL_8250_RUNTIME_UARTS work correctly"
  serial: samsung: enable clock before clearing pending interrupts during init
  serial/imx: disable hardware flow control at startup
  • Loading branch information
Linus Torvalds committed Jun 6, 2013
2 parents c6d6b9d + 317a684 commit 3b285cb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/tty/serial/8250/8250_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2755,7 +2755,7 @@ static void __init serial8250_isa_init_ports(void)
if (nr_uarts > UART_NR)
nr_uarts = UART_NR;

for (i = 0; i < UART_NR; i++) {
for (i = 0; i < nr_uarts; i++) {
struct uart_8250_port *up = &serial8250_ports[i];
struct uart_port *port = &up->port;

Expand Down Expand Up @@ -2916,7 +2916,7 @@ static int __init serial8250_console_setup(struct console *co, char *options)
* if so, search for the first available port that does have
* console support.
*/
if (co->index >= UART_NR)
if (co->index >= nr_uarts)
co->index = 0;
port = &serial8250_ports[co->index].port;
if (!port->iobase && !port->membase)
Expand Down Expand Up @@ -2957,7 +2957,7 @@ int serial8250_find_port(struct uart_port *p)
int line;
struct uart_port *port;

for (line = 0; line < UART_NR; line++) {
for (line = 0; line < nr_uarts; line++) {
port = &serial8250_ports[line].port;
if (uart_match_port(p, port))
return line;
Expand Down Expand Up @@ -3110,7 +3110,7 @@ static int serial8250_remove(struct platform_device *dev)
{
int i;

for (i = 0; i < UART_NR; i++) {
for (i = 0; i < nr_uarts; i++) {
struct uart_8250_port *up = &serial8250_ports[i];

if (up->port.dev == &dev->dev)
Expand Down Expand Up @@ -3178,7 +3178,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
/*
* First, find a port entry which matches.
*/
for (i = 0; i < UART_NR; i++)
for (i = 0; i < nr_uarts; i++)
if (uart_match_port(&serial8250_ports[i].port, port))
return &serial8250_ports[i];

Expand All @@ -3187,7 +3187,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
* free entry. We look for one which hasn't been previously
* used (indicated by zero iobase).
*/
for (i = 0; i < UART_NR; i++)
for (i = 0; i < nr_uarts; i++)
if (serial8250_ports[i].port.type == PORT_UNKNOWN &&
serial8250_ports[i].port.iobase == 0)
return &serial8250_ports[i];
Expand All @@ -3196,7 +3196,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
* That also failed. Last resort is to find any entry which
* doesn't have a real port associated with it.
*/
for (i = 0; i < UART_NR; i++)
for (i = 0; i < nr_uarts; i++)
if (serial8250_ports[i].port.type == PORT_UNKNOWN)
return &serial8250_ports[i];

Expand Down
2 changes: 2 additions & 0 deletions drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ static int imx_startup(struct uart_port *port)

temp = readl(sport->port.membase + UCR2);
temp |= (UCR2_RXEN | UCR2_TXEN);
if (!sport->have_rtscts)
temp |= UCR2_IRTS;
writel(temp, sport->port.membase + UCR2);

if (USE_IRDA(sport)) {
Expand Down
13 changes: 13 additions & 0 deletions drivers/tty/serial/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,18 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
ourport->tx_irq = ret;

ourport->clk = clk_get(&platdev->dev, "uart");
if (IS_ERR(ourport->clk)) {
pr_err("%s: Controller clock not found\n",
dev_name(&platdev->dev));
return PTR_ERR(ourport->clk);
}

ret = clk_prepare_enable(ourport->clk);
if (ret) {
pr_err("uart: clock failed to prepare+enable: %d\n", ret);
clk_put(ourport->clk);
return ret;
}

/* Keep all interrupts masked and cleared */
if (s3c24xx_serial_has_interrupt_mask(port)) {
Expand All @@ -1180,6 +1192,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,

/* reset the fifos (and setup the uart) */
s3c24xx_serial_resetport(port, cfg);
clk_disable_unprepare(ourport->clk);
return 0;
}

Expand Down

0 comments on commit 3b285cb

Please sign in to comment.