diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-04 09:07:19 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-04 09:07:19 +0100 |
commit | b8307db2477f9c551e54e0c7b643ea349a3349cd (patch) | |
tree | 88654f8bd73857bbd40f75013ce41d8882d16ce6 /drivers/spi/mpc52xx_psc_spi.c | |
parent | f0461d0146ee30927bc7efa2ae24ea8c6693b725 (diff) | |
parent | 061e41fdb5047b1fb161e89664057835935ca1d2 (diff) |
Merge commit 'v2.6.28-rc7' into tracing/core
Diffstat (limited to 'drivers/spi/mpc52xx_psc_spi.c')
-rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 0debe11b67b..3b97803e1d1 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c @@ -142,6 +142,7 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi, unsigned rfalarm; unsigned send_at_once = MPC52xx_PSC_BUFSIZE; unsigned recv_at_once; + int last_block = 0; if (!t->tx_buf && !t->rx_buf && t->len) return -EINVAL; @@ -151,15 +152,17 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi, while (rb < t->len) { if (t->len - rb > MPC52xx_PSC_BUFSIZE) { rfalarm = MPC52xx_PSC_RFALARM; + last_block = 0; } else { send_at_once = t->len - sb; rfalarm = MPC52xx_PSC_BUFSIZE - (t->len - rb); + last_block = 1; } dev_dbg(&spi->dev, "send %d bytes...\n", send_at_once); for (; send_at_once; sb++, send_at_once--) { /* set EOF flag before the last word is sent */ - if (send_at_once == 1) + if (send_at_once == 1 && last_block) out_8(&psc->ircr2, 0x01); if (tx_buf) |