Merge remote-tracking branch 'spi/topic/dma' into spi-next

This commit is contained in:
Mark Brown 2015-08-31 14:45:28 +01:00
commit 8e42ac814c

View file

@ -539,8 +539,15 @@ static int __spi_map_msg(struct spi_master *master, struct spi_message *msg)
if (!master->can_dma)
return 0;
tx_dev = master->dma_tx->device->dev;
rx_dev = master->dma_rx->device->dev;
if (master->dma_tx)
tx_dev = master->dma_tx->device->dev;
else
tx_dev = &master->dev;
if (master->dma_rx)
rx_dev = master->dma_rx->device->dev;
else
rx_dev = &master->dev;
list_for_each_entry(xfer, &msg->transfers, transfer_list) {
if (!master->can_dma(master, msg->spi, xfer))
@ -579,8 +586,15 @@ 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->device->dev;
rx_dev = master->dma_rx->device->dev;
if (master->dma_tx)
tx_dev = master->dma_tx->device->dev;
else
tx_dev = &master->dev;
if (master->dma_rx)
rx_dev = master->dma_rx->device->dev;
else
rx_dev = &master->dev;
list_for_each_entry(xfer, &msg->transfers, transfer_list) {
if (!master->can_dma(master, msg->spi, xfer))