diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2015-10-26 19:25:34 -0700 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2015-10-26 19:25:34 -0700 |
commit | c27ea6d1c09af5e493e7221572d17015b0317355 (patch) | |
tree | 1adb4e9b340da1464b4e960c4c19db815fcdfaa6 /drivers | |
parent | d6b6bf7de60aa2e2de4fbe946728a02f7d2e9390 (diff) |
tty: serial: fsl_lpuart: fix DMA parsing
With db6b1f827075 ("tty: serial: fsl_lpuart: implement module
parameter to disable DMA") the DMA channel parsing has been moved
to a function. However, assigning the pointer argument does not
update the pointer in the structure, hence it was no longer
possible to enable DMA.
Fix this by returning the channel, which is easier to read too.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/serial/fsl_lpuart.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index f6549ac5a8cf..be6c011b642d 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1798,13 +1798,16 @@ static struct uart_driver lpuart_reg = { .cons = LPUART_CONSOLE, }; -static void lpuart_request_dma_chan(struct lpuart_port *sport, - struct dma_chan *chan, const char *name) +static struct dma_chan *lpuart_request_dma_chan(struct lpuart_port *sport, + const char *name) { + struct dma_chan *chan; + chan = dma_request_slave_channel(sport->port.dev, name); if (!chan) dev_info(sport->port.dev, "DMA %s channel request failed, " "operating without %s DMA\n", name, name); + return chan; } static int lpuart_probe(struct platform_device *pdev) @@ -1877,8 +1880,8 @@ static int lpuart_probe(struct platform_device *pdev) } if (!nodma) { - lpuart_request_dma_chan(sport, sport->dma_tx_chan, "tx"); - lpuart_request_dma_chan(sport, sport->dma_rx_chan, "rx"); + sport->dma_tx_chan = lpuart_request_dma_chan(sport, "tx"); + sport->dma_rx_chan = lpuart_request_dma_chan(sport, "rx"); } if (of_property_read_bool(np, "linux,rs485-enabled-at-boot-time")) { |