]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/serial/cpm_uart/cpm_uart_core.c
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[linux-2.6-omap-h63xx.git] / drivers / serial / cpm_uart / cpm_uart_core.c
index a6c4d744495e3b694894c35453bbac4a0baff512..5c6ef51da274db66b60e2e83cd2195044b55d252 100644 (file)
@@ -406,6 +406,18 @@ static int cpm_uart_startup(struct uart_port *port)
 
        pr_debug("CPM uart[%d]:startup\n", port->line);
 
+       /* If the port is not the console, make sure rx is disabled. */
+       if (!(pinfo->flags & FLAG_CONSOLE)) {
+               /* Disable UART rx */
+               if (IS_SMC(pinfo)) {
+                       clrbits16(&pinfo->smcp->smc_smcmr, SMCMR_REN);
+                       clrbits8(&pinfo->smcp->smc_smcm, SMCM_RX);
+               } else {
+                       clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR);
+                       clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX);
+               }
+               cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
+       }
        /* Install interrupt handler. */
        retval = request_irq(port->irq, cpm_uart_int, 0, "cpm_uart", port);
        if (retval)
@@ -420,8 +432,6 @@ static int cpm_uart_startup(struct uart_port *port)
                setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));
        }
 
-       if (!(pinfo->flags & FLAG_CONSOLE))
-               cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
        return 0;
 }
 
@@ -623,7 +633,7 @@ static int cpm_uart_verify_port(struct uart_port *port,
 
        if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM)
                ret = -EINVAL;
-       if (ser->irq < 0 || ser->irq >= NR_IRQS)
+       if (ser->irq < 0 || ser->irq >= nr_irqs)
                ret = -EINVAL;
        if (ser->baud_base < 9600)
                ret = -EINVAL;