From: Geert Uytterhoeven Date: Thu, 10 Jul 2014 13:29:33 +0000 (+0200) Subject: spi: core: Pass correct device to dma_map_sg() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3fc25421f55e36426f5e5cc227cacc840493a943;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 91bb512e1009..e691e281e3a2 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -649,8 +649,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)) @@ -689,8 +689,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))