summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/samsung.c
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2014-12-10 14:49:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-10 01:25:39 +0300
commit658c9d2b735fbc066a6608754b0eda77c92e637b (patch)
tree57815a986c4ad06568d2ba6a237b46a9db238e11 /drivers/tty/serial/samsung.c
parent7bb6b2f65e6ce9743df42fabbf124e4ef9dc226b (diff)
downloadlinux-658c9d2b735fbc066a6608754b0eda77c92e637b.tar.xz
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: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/samsung.c')
-rw-r--r--drivers/tty/serial/samsung.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 19273e31d224..7196a3e586cf 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -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)) {