--- zzzz-none-000/linux-3.10.107/drivers/tty/serial/ucc_uart.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/tty/serial/ucc_uart.c 2021-02-04 17:41:59.000000000 +0000 @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include @@ -269,7 +271,7 @@ return 1; bdp++; - }; + } } /* @@ -433,16 +435,6 @@ clrbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_RX); } -/* - * Enable status change interrupts - * - * We don't support status change interrupts, but we need to define this - * function otherwise the kernel will panic. - */ -static void qe_uart_enable_ms(struct uart_port *port) -{ -} - /* Start or stop sending break signal * * This function controls the sending of a break signal. If break_state=1, @@ -934,7 +926,7 @@ port->read_status_mask = BD_SC_EMPTY | BD_SC_OV; if (termios->c_iflag & INPCK) port->read_status_mask |= BD_SC_FR | BD_SC_PR; - if (termios->c_iflag & (BRKINT | PARMRK)) + if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) port->read_status_mask |= BD_SC_BR; /* @@ -958,7 +950,7 @@ if ((termios->c_cflag & CREAD) == 0) port->read_status_mask &= ~BD_SC_EMPTY; - baud = uart_get_baud_rate(port, termios, old, 0, 115200); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); /* Do we really need a spinlock here? */ spin_lock_irqsave(&port->lock, flags); @@ -1100,7 +1092,6 @@ .stop_tx = qe_uart_stop_tx, .start_tx = qe_uart_start_tx, .stop_rx = qe_uart_stop_rx, - .enable_ms = qe_uart_enable_ms, .break_ctl = qe_uart_break_ctl, .startup = qe_uart_startup, .shutdown = qe_uart_shutdown, @@ -1451,7 +1442,7 @@ goto out_np; } - dev_set_drvdata(&ofdev->dev, qe_port); + platform_set_drvdata(ofdev, qe_port); dev_info(&ofdev->dev, "UCC%u assigned to /dev/ttyQE%u\n", qe_port->ucc_num + 1, qe_port->port.line); @@ -1471,23 +1462,25 @@ static int ucc_uart_remove(struct platform_device *ofdev) { - struct uart_qe_port *qe_port = dev_get_drvdata(&ofdev->dev); + struct uart_qe_port *qe_port = platform_get_drvdata(ofdev); dev_info(&ofdev->dev, "removing /dev/ttyQE%u\n", qe_port->port.line); uart_remove_one_port(&ucc_uart_driver, &qe_port->port); - dev_set_drvdata(&ofdev->dev, NULL); kfree(qe_port); return 0; } -static struct of_device_id ucc_uart_match[] = { +static const struct of_device_id ucc_uart_match[] = { { .type = "serial", .compatible = "ucc_uart", }, + { + .compatible = "fsl,t1040-ucc-uart", + }, {}, }; MODULE_DEVICE_TABLE(of, ucc_uart_match); @@ -1495,7 +1488,6 @@ static struct platform_driver ucc_uart_of_driver = { .driver = { .name = "ucc_uart", - .owner = THIS_MODULE, .of_match_table = ucc_uart_match, }, .probe = ucc_uart_probe, @@ -1518,9 +1510,11 @@ } ret = platform_driver_register(&ucc_uart_of_driver); - if (ret) + if (ret) { printk(KERN_ERR "ucc-uart: could not register platform driver\n"); + uart_unregister_driver(&ucc_uart_driver); + } return ret; }