[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1418212167-28992-3-git-send-email-r.baldyga@samsung.com>
Date: Wed, 10 Dec 2014 12:49:23 +0100
From: Robert Baldyga <r.baldyga@...sung.com>
To: gregkh@...uxfoundation.org
Cc: jslaby@...e.cz, akpm@...ux-foundation.org, kgene.kim@...sung.com,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
m.szyprowski@...sung.com, kyungmin.park@...sung.com,
l.czerwinski@...sung.com, s.nawrocki@...sung.com,
Robert Baldyga <r.baldyga@...sung.com>
Subject: [PATCH 2/6] 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@...sung.com>
---
drivers/tty/serial/samsung.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 19273e3..7196a3e 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)) {
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists