Skip to content

Commit

Permalink
serial: samsung: alloc dma stucture in ourport
Browse files Browse the repository at this point in the history
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: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Robert Baldyga authored and Greg Kroah-Hartman committed Jan 9, 2015
1 parent 7bb6b2f commit 658c9d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/tty/serial/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 658c9d2

Please sign in to comment.