diff options
author | Mark Brown <broonie@linaro.org> | 2014-08-04 17:20:53 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-08-04 17:20:53 +0100 |
commit | 9afabfe3f8f59f68ad69dd69258eded7545b4dbe (patch) | |
tree | 043380908f5a18e8f045953788802d94b12312ef /drivers | |
parent | 19583ca584d6f574384e17fe7613dfaeadcdc4a6 (diff) | |
parent | 3fc25421f55e36426f5e5cc227cacc840493a943 (diff) |
Merge remote-tracking branch 'spi/fix/core' into spi-linus
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index d4f9670b51b..e691e281e3a 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -619,6 +619,8 @@ static int spi_map_buf(struct spi_master *master, struct device *dev, } ret = dma_map_sg(dev, sgt->sgl, sgt->nents, dir); + if (!ret) + ret = -ENOMEM; if (ret < 0) { sg_free_table(sgt); return ret; @@ -647,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)) @@ -687,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)) |