--- zzzz-none-000/linux-3.10.107/drivers/tty/serial/lantiq.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/tty/serial/lantiq.c 2021-02-04 17:41:59.000000000 +0000 @@ -21,7 +21,6 @@ */ #include -#include #include #include #include @@ -154,11 +153,6 @@ ltq_w32(ASCWHBSTATE_CLRREN, port->membase + LTQ_ASC_WHBSTATE); } -static void -lqasc_enable_ms(struct uart_port *port) -{ -} - static int lqasc_rx_chars(struct uart_port *port) { @@ -318,7 +312,7 @@ struct ltq_uart_port *ltq_port = to_ltq_uart_port(port); int retval; - if (ltq_port->clk) + if (!IS_ERR(ltq_port->clk)) clk_enable(ltq_port->clk); port->uartclk = clk_get_rate(ltq_port->fpiclk); @@ -386,7 +380,7 @@ port->membase + LTQ_ASC_RXFCON); ltq_w32_mask(ASCTXFCON_TXFEN, ASCTXFCON_TXFFLU, port->membase + LTQ_ASC_TXFCON); - if (ltq_port->clk) + if (!IS_ERR(ltq_port->clk)) clk_disable(ltq_port->clk); } @@ -502,8 +496,10 @@ static void lqasc_release_port(struct uart_port *port) { + struct platform_device *pdev = to_platform_device(port->dev); + if (port->flags & UPF_IOREMAP) { - iounmap(port->membase); + devm_iounmap(&pdev->dev, port->membase); port->membase = NULL; } } @@ -568,7 +564,6 @@ .stop_tx = lqasc_stop_tx, .start_tx = lqasc_start_tx, .stop_rx = lqasc_stop_rx, - .enable_ms = lqasc_enable_ms, .break_ctl = lqasc_break_ctl, .startup = lqasc_startup, .shutdown = lqasc_shutdown, @@ -636,6 +631,9 @@ port = <q_port->port; + if (!IS_ERR(ltq_port->clk)) + clk_enable(ltq_port->clk); + port->uartclk = clk_get_rate(ltq_port->fpiclk); if (options) @@ -706,7 +704,7 @@ port = <q_port->port; port->iotype = SERIAL_IO_MEM; - port->flags = ASYNC_BOOT_AUTOCONF | UPF_IOREMAP; + port->flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP; port->ops = &lqasc_pops; port->fifosize = 16; port->type = PORT_LTQ_ASC, @@ -741,12 +739,10 @@ { .compatible = DRVNAME }, {}, }; -MODULE_DEVICE_TABLE(of, ltq_asc_match); static struct platform_driver lqasc_driver = { .driver = { .name = DRVNAME, - .owner = THIS_MODULE, .of_match_table = ltq_asc_match, }, }; @@ -766,8 +762,4 @@ return ret; } - -module_init(init_lqasc); - -MODULE_DESCRIPTION("Lantiq serial port driver"); -MODULE_LICENSE("GPL"); +device_initcall(init_lqasc);