summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-12-22 00:10:01 -0700
committerGrant Likely <grant.likely@secretlab.ca>2010-12-22 00:10:01 -0700
commit752a4a95e3c96a8e8d3405b16d292f13e8c7856b (patch)
tree838e43696fdc45b83f082eef7230d79cfe699497 /drivers/spi
parentbc3f67a3e1b20756d4bfa5886a6b8fd0c068e6a4 (diff)
parent90a8a73c06cc32b609a880d48449d7083327e11a (diff)
downloadlinux-752a4a95e3c96a8e8d3405b16d292f13e8c7856b.tar.bz2
Merge commit 'v2.6.37-rc7' into spi/next
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/atmel_spi.c6
-rw-r--r--drivers/spi/dw_spi.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 154529aacc03..a067046c9da2 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -352,8 +352,12 @@ atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer)
xfer->tx_dma = xfer->rx_dma = INVALID_DMA_ADDRESS;
if (xfer->tx_buf) {
+ /* tx_buf is a const void* where we need a void * for the dma
+ * mapping */
+ void *nonconst_tx = (void *)xfer->tx_buf;
+
xfer->tx_dma = dma_map_single(dev,
- (void *) xfer->tx_buf, xfer->len,
+ nonconst_tx, xfer->len,
DMA_TO_DEVICE);
if (dma_mapping_error(dev, xfer->tx_dma))
return -ENOMEM;
diff --git a/drivers/spi/dw_spi.c b/drivers/spi/dw_spi.c
index 90439314cf67..0838c79861e4 100644
--- a/drivers/spi/dw_spi.c
+++ b/drivers/spi/dw_spi.c
@@ -413,6 +413,11 @@ static void poll_transfer(struct dw_spi *dws)
{
while (dws->write(dws))
dws->read(dws);
+ /*
+ * There is a possibility that the last word of a transaction
+ * will be lost if data is not ready. Re-read to solve this issue.
+ */
+ dws->read(dws);
transfer_complete(dws);
}