提交 658c9d2b 编写于 作者: R Robert Baldyga 提交者: Greg Kroah-Hartman

serial: samsung: alloc dma stucture in ourport

When we have "dmas" property in serial node in device-tree, we do
memory alocation for dma structure which will be used in DMA handling
code.

Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski.
Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7bb6b2f6
......@@ -1209,6 +1209,18 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
ret = platform_get_irq(platdev, 1);
if (ret > 0)
ourport->tx_irq = ret;
/*
* DMA is currently supported only on DT platforms, if DMA properties
* are specified.
*/
if (platdev->dev.of_node && of_find_property(platdev->dev.of_node,
"dmas", NULL)) {
ourport->dma = devm_kzalloc(port->dev,
sizeof(*ourport->dma),
GFP_KERNEL);
if (!ourport->dma)
return -ENOMEM;
}
ourport->clk = clk_get(&platdev->dev, "uart");
if (IS_ERR(ourport->clk)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册