]> Pileus Git - ~andy/linux/blobdiff - drivers/tty/serial/imx.c
[SCSI] zfcp: return early from slave_destroy if slave_alloc returned early
[~andy/linux] / drivers / tty / serial / imx.c
index 7e91b3d368cd1ddc26e07e5a6de42b6b94752121..163fc9021f5ad58a695c0fded23a300ed49b4627 100644 (file)
@@ -508,8 +508,10 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
                if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx))
                        continue;
 
-               if (rx & (URXD_PRERR | URXD_OVRRUN | URXD_FRMERR) ) {
-                       if (rx & URXD_PRERR)
+               if (unlikely(rx & URXD_ERR)) {
+                       if (rx & URXD_BRK)
+                               sport->port.icount.brk++;
+                       else if (rx & URXD_PRERR)
                                sport->port.icount.parity++;
                        else if (rx & URXD_FRMERR)
                                sport->port.icount.frame++;
@@ -524,7 +526,9 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
 
                        rx &= sport->port.read_status_mask;
 
-                       if (rx & URXD_PRERR)
+                       if (rx & URXD_BRK)
+                               flg = TTY_BREAK;
+                       else if (rx & URXD_PRERR)
                                flg = TTY_PARITY;
                        else if (rx & URXD_FRMERR)
                                flg = TTY_FRAME;
@@ -1286,17 +1290,20 @@ static int serial_imx_resume(struct platform_device *dev)
 static int serial_imx_probe_dt(struct imx_port *sport,
                struct platform_device *pdev)
 {
-       static int portnum = 0;
        struct device_node *np = pdev->dev.of_node;
        const struct of_device_id *of_id =
                        of_match_device(imx_uart_dt_ids, &pdev->dev);
+       int ret;
 
        if (!np)
                return -ENODEV;
 
-       sport->port.line = portnum++;
-       if (sport->port.line >= UART_NR)
-               return -EINVAL;
+       ret = of_alias_get_id(np, "serial");
+       if (ret < 0) {
+               dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret);
+               return -ENODEV;
+       }
+       sport->port.line = ret;
 
        if (of_get_property(np, "fsl,uart-has-rtscts", NULL))
                sport->have_rtscts = 1;