diff options
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 25 | ||||
-rw-r--r-- | include/linux/serial_sci.h | 2 |
2 files changed, 8 insertions, 19 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index a9414facda47..dbd32a1286d3 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1439,12 +1439,8 @@ static bool filter(struct dma_chan *chan, void *slave) | |||
1439 | dev_dbg(chan->device->dev, "%s: slave ID %d\n", __func__, | 1439 | dev_dbg(chan->device->dev, "%s: slave ID %d\n", __func__, |
1440 | param->slave_id); | 1440 | param->slave_id); |
1441 | 1441 | ||
1442 | if (param->dma_dev == chan->device->dev) { | 1442 | chan->private = param; |
1443 | chan->private = param; | 1443 | return true; |
1444 | return true; | ||
1445 | } else { | ||
1446 | return false; | ||
1447 | } | ||
1448 | } | 1444 | } |
1449 | 1445 | ||
1450 | static void rx_timer_fn(unsigned long arg) | 1446 | static void rx_timer_fn(unsigned long arg) |
@@ -1470,10 +1466,10 @@ static void sci_request_dma(struct uart_port *port) | |||
1470 | dma_cap_mask_t mask; | 1466 | dma_cap_mask_t mask; |
1471 | int nent; | 1467 | int nent; |
1472 | 1468 | ||
1473 | dev_dbg(port->dev, "%s: port %d DMA %p\n", __func__, | 1469 | dev_dbg(port->dev, "%s: port %d\n", __func__, |
1474 | port->line, s->cfg->dma_dev); | 1470 | port->line); |
1475 | 1471 | ||
1476 | if (!s->cfg->dma_dev) | 1472 | if (s->cfg->dma_slave_tx <= 0 || s->cfg->dma_slave_rx <= 0) |
1477 | return; | 1473 | return; |
1478 | 1474 | ||
1479 | dma_cap_zero(mask); | 1475 | dma_cap_zero(mask); |
@@ -1483,7 +1479,6 @@ static void sci_request_dma(struct uart_port *port) | |||
1483 | 1479 | ||
1484 | /* Slave ID, e.g., SHDMA_SLAVE_SCIF0_TX */ | 1480 | /* Slave ID, e.g., SHDMA_SLAVE_SCIF0_TX */ |
1485 | param->slave_id = s->cfg->dma_slave_tx; | 1481 | param->slave_id = s->cfg->dma_slave_tx; |
1486 | param->dma_dev = s->cfg->dma_dev; | ||
1487 | 1482 | ||
1488 | s->cookie_tx = -EINVAL; | 1483 | s->cookie_tx = -EINVAL; |
1489 | chan = dma_request_channel(mask, filter, param); | 1484 | chan = dma_request_channel(mask, filter, param); |
@@ -1512,7 +1507,6 @@ static void sci_request_dma(struct uart_port *port) | |||
1512 | 1507 | ||
1513 | /* Slave ID, e.g., SHDMA_SLAVE_SCIF0_RX */ | 1508 | /* Slave ID, e.g., SHDMA_SLAVE_SCIF0_RX */ |
1514 | param->slave_id = s->cfg->dma_slave_rx; | 1509 | param->slave_id = s->cfg->dma_slave_rx; |
1515 | param->dma_dev = s->cfg->dma_dev; | ||
1516 | 1510 | ||
1517 | chan = dma_request_channel(mask, filter, param); | 1511 | chan = dma_request_channel(mask, filter, param); |
1518 | dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan); | 1512 | dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan); |
@@ -1557,9 +1551,6 @@ static void sci_free_dma(struct uart_port *port) | |||
1557 | { | 1551 | { |
1558 | struct sci_port *s = to_sci_port(port); | 1552 | struct sci_port *s = to_sci_port(port); |
1559 | 1553 | ||
1560 | if (!s->cfg->dma_dev) | ||
1561 | return; | ||
1562 | |||
1563 | if (s->chan_tx) | 1554 | if (s->chan_tx) |
1564 | sci_tx_dma_release(s, false); | 1555 | sci_tx_dma_release(s, false); |
1565 | if (s->chan_rx) | 1556 | if (s->chan_rx) |
@@ -1967,9 +1958,9 @@ static int __devinit sci_init_single(struct platform_device *dev, | |||
1967 | port->serial_in = sci_serial_in; | 1958 | port->serial_in = sci_serial_in; |
1968 | port->serial_out = sci_serial_out; | 1959 | port->serial_out = sci_serial_out; |
1969 | 1960 | ||
1970 | if (p->dma_dev) | 1961 | if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) |
1971 | dev_dbg(port->dev, "DMA device %p, tx %d, rx %d\n", | 1962 | dev_dbg(port->dev, "DMA tx %d, rx %d\n", |
1972 | p->dma_dev, p->dma_slave_tx, p->dma_slave_rx); | 1963 | p->dma_slave_tx, p->dma_slave_rx); |
1973 | 1964 | ||
1974 | return 0; | 1965 | return 0; |
1975 | } | 1966 | } |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 8bffe9ae2ca0..0efa1f10bc2b 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -131,8 +131,6 @@ struct plat_sci_port { | |||
131 | 131 | ||
132 | struct plat_sci_port_ops *ops; | 132 | struct plat_sci_port_ops *ops; |
133 | 133 | ||
134 | struct device *dma_dev; | ||
135 | |||
136 | unsigned int dma_slave_tx; | 134 | unsigned int dma_slave_tx; |
137 | unsigned int dma_slave_rx; | 135 | unsigned int dma_slave_rx; |
138 | }; | 136 | }; |