Re: [PATCH 1/2] spi: davinci: Use SPI framework to handle DMA mapping
From: Mark Brown
Date: Mon Feb 06 2017 - 11:48:38 EST
On Mon, Feb 06, 2017 at 03:57:07PM +0100, Fabien Parent wrote:
> This commit updates the davinci SPI driver in order to use the SPI
> framework to handle the DMA mapping of buffers coming from an upper
> layer.
This claims to be using the framework to do DMA mapping but...
> + if (!t->rx_buf) {
> + sg_init_table(&sg_rx, 1);
> + t->rx_dma = dma_map_single(&spi->dev, dummy_buf,
> + t->len, DMA_FROM_DEVICE);
> + if (dma_mapping_error(&spi->dev, !t->rx_dma)) {
> + ret = -EFAULT;
> + goto err_rx_map;
> + }
> + sg_dma_address(&sg_rx) = t->rx_dma;
> + sg_dma_len(&sg_rx) = t->len;
...adds code that does DMA mapping. That's confusing?
Attachment:
signature.asc
Description: PGP signature