summaryrefslogtreecommitdiff
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2014-07-10 15:29:33 +0200
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:20:39 -0500
commit82294449dfb4e712fa13c03215fdfcb425a5d4ab (patch)
treea90fef47b637529b4dc757c0d9893b8704369413 /drivers/spi/spi.c
parentf597dac456453d193f826c08e32e4db4667576f8 (diff)
spi: core: Pass correct device to dma_map_sg()
According to Documentation/dmaengine.txt, scatterlists must be mapped using the DMA struct device. However, "dma_chan.dev->device" is the sysfs class device's device. Use "dma_chan.device->dev" instead, which is the real DMA device's device. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit 3fc25421f55e36426f5e5cc227cacc840493a943) (cherry picked from commit ff593afabbe51959293cf8434bbe72a3db24dda5)
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3813f7fe1331..d47bfb909112 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -652,8 +652,8 @@ static int __spi_map_msg(struct spi_master *master, struct spi_message *msg)
if (!master->can_dma)
return 0;
- tx_dev = &master->dma_tx->dev->device;
- rx_dev = &master->dma_rx->dev->device;
+ tx_dev = master->dma_tx->device->dev;
+ rx_dev = master->dma_rx->device->dev;
list_for_each_entry(xfer, &msg->transfers, transfer_list) {
if (!master->can_dma(master, msg->spi, xfer))
@@ -692,8 +692,8 @@ static int spi_unmap_msg(struct spi_master *master, struct spi_message *msg)
if (!master->cur_msg_mapped || !master->can_dma)
return 0;
- tx_dev = &master->dma_tx->dev->device;
- rx_dev = &master->dma_rx->dev->device;
+ tx_dev = master->dma_tx->device->dev;
+ rx_dev = master->dma_rx->device->dev;
list_for_each_entry(xfer, &msg->transfers, transfer_list) {
if (!master->can_dma(master, msg->spi, xfer))