diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2016-03-24 15:35:44 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-03-28 10:42:00 +0100 |
commit | 8c3ad488fe0e4478b3b29b9501074c5fb1bfda0d (patch) | |
tree | 8d95788523f52330b5396cc96de8ec231caa12b8 /drivers/spi/spi-pxa2xx-dma.c | |
parent | 68335ec76e45fb3a1b796b26c3ea49ce1231d8fb (diff) | |
download | linux-8c3ad488fe0e4478b3b29b9501074c5fb1bfda0d.tar.bz2 |
spi: pxa2xx: Use dummy buffers provided by SPI core
Dummy buffer is used for half duplex transfers that don't have TX or RX
buffer set. Instead of own dummy buffer management here let the SPI core to
handle it by setting the SPI_MASTER_MUST_RX and SPI_MASTER_MUST_TX flags.
Then core makes sure both transfer buffers are set.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx-dma.c')
-rw-r--r-- | drivers/spi/spi-pxa2xx-dma.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c index 624cb06bd2e1..a18a03d0afb7 100644 --- a/drivers/spi/spi-pxa2xx-dma.c +++ b/drivers/spi/spi-pxa2xx-dma.c @@ -53,11 +53,7 @@ static int pxa2xx_spi_map_dma_buffer(struct driver_data *drv_data, for_each_sg(sgt->sgl, sg, sgt->nents, i) { size_t bytes = min_t(size_t, len, SZ_2K); - if (buf) - sg_set_buf(sg, pbuf, bytes); - else - sg_set_buf(sg, drv_data->dummy, bytes); - + sg_set_buf(sg, pbuf, bytes); pbuf += bytes; len -= bytes; } @@ -312,10 +308,6 @@ int pxa2xx_spi_dma_setup(struct driver_data *drv_data) dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - drv_data->dummy = devm_kzalloc(dev, SZ_2K, GFP_KERNEL); - if (!drv_data->dummy) - return -ENOMEM; - drv_data->tx_chan = dma_request_slave_channel_compat(mask, pdata->dma_filter, pdata->tx_param, dev, "tx"); if (!drv_data->tx_chan) |