summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorAisheng.Dong <b29396@freescale.com>2010-09-14 14:23:01 +0800
committerAlan Tull <r80115@freescale.com>2010-09-25 09:53:44 -0500
commit0bef5378d18f3ce2d8028151d8fb683beee4ad00 (patch)
tree1f224ad53f00804ca49abc33da45b49a55db8fce /drivers/spi
parent474d5ad35967fc05e60463c13882eb5e34c323a0 (diff)
ENGR00131466-8 mxs spi: calculate the actual_length transferred.
If we do not do actual_length calculation, the upper layer of spi may fail when performing data sanity check such as m25p80 spi nor. Signed-off-by: Aisheng.Dong <b29396@freescale.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi_mxs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi_mxs.c b/drivers/spi/spi_mxs.c
index 149d24a9b833..a6ca0619e82e 100644
--- a/drivers/spi/spi_mxs.c
+++ b/drivers/spi/spi_mxs.c
@@ -426,6 +426,7 @@ static int mxs_spi_handle_message(struct mxs_spi *ss, struct spi_message *m)
}
}
+ m->actual_length += t->len;
if (status)
break;
@@ -480,6 +481,7 @@ static int mxs_spi_transfer(struct spi_device *spi, struct spi_message *m)
struct mxs_spi *ss = spi_master_get_devdata(spi->master);
unsigned long flags;
+ m->actual_length = 0;
m->status = -EINPROGRESS;
spin_lock_irqsave(&ss->lock, flags);
list_add_tail(&m->queue, &ss->queue);