diff options
author | Mark Brown <broonie@kernel.org> | 2015-08-31 16:45:28 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-08-31 16:45:28 +0300 |
commit | 8e42ac814c63dd5c5e39bbbfbc9c6578e19c765f (patch) | |
tree | 2719d5d2e754710e8c9d33587adf121cf6f16e80 /drivers/spi/spi.c | |
parent | bc6450994976f26bbde656b1994f95b955bdabfc (diff) | |
parent | c37f45b5f1cdfcdc351d88950b32658c970582ca (diff) | |
download | linux-8e42ac814c63dd5c5e39bbbfbc9c6578e19c765f.tar.xz |
Merge remote-tracking branch 'spi/topic/dma' into spi-next
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r-- | drivers/spi/spi.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 829323ce7cdf..24678ea45c57 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -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)) |