diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2015-09-21 07:17:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-04 13:38:45 -0400 |
commit | 2559318caa76028edc9c0553932a17139e6adc58 (patch) | |
tree | e16fc5ec1c639aea86acf03cbf3078df8771c0bd | |
parent | 1bd8edba10e6aa275434a8daa7ddcaf849fe49ad (diff) |
serial: 8250_dw: hook the DMA in one place
Instead of assigning the dma member in dw8250_probe_of and
dw8250_probe_acpi separately, assigning it in dw8250_probe.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/8250/8250_dw.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 346061718e91..d69d0984484f 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c | |||
@@ -302,14 +302,6 @@ static int dw8250_probe_of(struct uart_port *p, | |||
302 | if (has_ucv) | 302 | if (has_ucv) |
303 | dw8250_setup_port(up); | 303 | dw8250_setup_port(up); |
304 | 304 | ||
305 | /* if we have a valid fifosize, try hooking up DMA here */ | ||
306 | if (p->fifosize) { | ||
307 | up->dma = &data->dma; | ||
308 | |||
309 | up->dma->rxconf.src_maxburst = p->fifosize / 4; | ||
310 | up->dma->txconf.dst_maxburst = p->fifosize / 4; | ||
311 | } | ||
312 | |||
313 | /* get index of serial line, if found in DT aliases */ | 305 | /* get index of serial line, if found in DT aliases */ |
314 | id = of_alias_get_id(np, "serial"); | 306 | id = of_alias_get_id(np, "serial"); |
315 | if (id >= 0) | 307 | if (id >= 0) |
@@ -348,10 +340,6 @@ static int dw8250_probe_acpi(struct uart_8250_port *up, | |||
348 | data->dma.fn = dw8250_idma_filter; | 340 | data->dma.fn = dw8250_idma_filter; |
349 | } | 341 | } |
350 | 342 | ||
351 | up->dma = &data->dma; | ||
352 | up->dma->rxconf.src_maxburst = p->fifosize / 4; | ||
353 | up->dma->txconf.dst_maxburst = p->fifosize / 4; | ||
354 | |||
355 | up->port.set_termios = dw8250_set_termios; | 343 | up->port.set_termios = dw8250_set_termios; |
356 | 344 | ||
357 | return 0; | 345 | return 0; |
@@ -498,6 +486,13 @@ static int dw8250_probe(struct platform_device *pdev) | |||
498 | goto err_reset; | 486 | goto err_reset; |
499 | } | 487 | } |
500 | 488 | ||
489 | /* If we have a valid fifosize, try hooking up DMA */ | ||
490 | if (p->fifosize) { | ||
491 | data->dma.rxconf.src_maxburst = p->fifosize / 4; | ||
492 | data->dma.txconf.dst_maxburst = p->fifosize / 4; | ||
493 | uart.dma = &data->dma; | ||
494 | } | ||
495 | |||
501 | data->line = serial8250_register_8250_port(&uart); | 496 | data->line = serial8250_register_8250_port(&uart); |
502 | if (data->line < 0) { | 497 | if (data->line < 0) { |
503 | err = data->line; | 498 | err = data->line; |