aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorTomasz Figa <tomasz.figa@gmail.com>2013-08-10 20:33:30 -0400
committerMark Brown <broonie@linaro.org>2013-08-11 09:06:30 -0400
commit90438c4bf987a653ad8679a4fa25a909f0c642b5 (patch)
tree952bebf17e27d9a05b113f509c82cc372669b762 /drivers/spi
parent0149871c428cc8cb44337703ca46a98a6b541b42 (diff)
spi: s3c64xx: Use dmaengine_prep_slave_single() to prepare DMA transfers
Since the driver supports only contiguous buffers, there is no need to manually construct a scatterlist with just a single entry, when there is a dedicated helper for this purpose. This patch modifies prepare_dma() function to use available helper instead of manually creating a scatterlist. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-s3c64xx.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 2330dceb27cc..a7a739c89488 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -389,7 +389,6 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
389{ 389{
390 struct s3c64xx_spi_driver_data *sdd; 390 struct s3c64xx_spi_driver_data *sdd;
391 struct dma_slave_config config; 391 struct dma_slave_config config;
392 struct scatterlist sg;
393 struct dma_async_tx_descriptor *desc; 392 struct dma_async_tx_descriptor *desc;
394 393
395 memset(&config, 0, sizeof(config)); 394 memset(&config, 0, sizeof(config));
@@ -412,14 +411,8 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
412 dmaengine_slave_config(dma->ch, &config); 411 dmaengine_slave_config(dma->ch, &config);
413 } 412 }
414 413
415 sg_init_table(&sg, 1); 414 desc = dmaengine_prep_slave_single(dma->ch, buf, len,
416 sg_dma_len(&sg) = len; 415 dma->direction, DMA_PREP_INTERRUPT);
417 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)),
418 len, offset_in_page(buf));
419 sg_dma_address(&sg) = buf;
420
421 desc = dmaengine_prep_slave_sg(dma->ch,
422 &sg, 1, dma->direction, DMA_PREP_INTERRUPT);
423 416
424 desc->callback = s3c64xx_spi_dmacb; 417 desc->callback = s3c64xx_spi_dmacb;
425 desc->callback_param = dma; 418 desc->callback_param = dma;