s->chan_rx = NULL;
s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL;
- dma_release_channel(chan);
- dma_free_coherent(port->dev, s->buf_len_rx * 2,
+ dma_free_coherent(chan->device->dev, s->buf_len_rx * 2,
sg_virt(&s->sg_rx[0]), sg_dma_address(&s->sg_rx[0]));
+ dma_release_channel(chan);
if (enable_pio)
sci_start_rx(port);
}
return;
}
- dma_sync_sg_for_device(port->dev, sg, 1, DMA_TO_DEVICE);
+ dma_sync_sg_for_device(chan->device->dev, sg, 1, DMA_TO_DEVICE);
spin_lock_irq(&port->lock);
s->desc_tx = desc;
sg_set_page(&s->sg_tx, virt_to_page(port->state->xmit.buf),
UART_XMIT_SIZE,
(uintptr_t)port->state->xmit.buf & ~PAGE_MASK);
- nent = dma_map_sg(port->dev, &s->sg_tx, 1, DMA_TO_DEVICE);
+ nent = dma_map_sg(chan->device->dev, &s->sg_tx, 1,
+ DMA_TO_DEVICE);
if (!nent) {
dev_warn(port->dev, "Failed mapping Tx DMA descriptor\n");
dma_release_channel(chan);
s->chan_rx = chan;
s->buf_len_rx = 2 * max(16, (int)port->fifosize);
- buf[0] = dma_alloc_coherent(port->dev, s->buf_len_rx * 2,
- &dma[0], GFP_KERNEL);
+ buf[0] = dma_alloc_coherent(chan->device->dev,
+ s->buf_len_rx * 2, &dma[0],
+ GFP_KERNEL);
if (!buf[0]) {
dev_warn(port->dev,