aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/mpc52xx_psc_spi.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
committerJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
commitec98ce480ada787f2cfbd696980ff3564415505b (patch)
tree1a4d644b38f9f1e4b4e086fde0b195df4a92cf84 /drivers/spi/mpc52xx_psc_spi.c
parent3496f92beb9aa99ef21fccc154a36c7698e9c538 (diff)
parentfeaf3848a813a106f163013af6fcf6c4bfec92d9 (diff)
Merge branch 'master' into next
Conflicts: fs/nfsd/nfs4recover.c Manually fixed above to use new creds API functions, e.g. nfs4_save_creds(). Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/spi/mpc52xx_psc_spi.c')
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index 0debe11b67b4..3b97803e1d11 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,
142 unsigned rfalarm; 142 unsigned rfalarm;
143 unsigned send_at_once = MPC52xx_PSC_BUFSIZE; 143 unsigned send_at_once = MPC52xx_PSC_BUFSIZE;
144 unsigned recv_at_once; 144 unsigned recv_at_once;
145 int last_block = 0;
145 146
146 if (!t->tx_buf && !t->rx_buf && t->len) 147 if (!t->tx_buf && !t->rx_buf && t->len)
147 return -EINVAL; 148 return -EINVAL;
@@ -151,15 +152,17 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
151 while (rb < t->len) { 152 while (rb < t->len) {
152 if (t->len - rb > MPC52xx_PSC_BUFSIZE) { 153 if (t->len - rb > MPC52xx_PSC_BUFSIZE) {
153 rfalarm = MPC52xx_PSC_RFALARM; 154 rfalarm = MPC52xx_PSC_RFALARM;
155 last_block = 0;
154 } else { 156 } else {
155 send_at_once = t->len - sb; 157 send_at_once = t->len - sb;
156 rfalarm = MPC52xx_PSC_BUFSIZE - (t->len - rb); 158 rfalarm = MPC52xx_PSC_BUFSIZE - (t->len - rb);
159 last_block = 1;
157 } 160 }
158 161
159 dev_dbg(&spi->dev, "send %d bytes...\n", send_at_once); 162 dev_dbg(&spi->dev, "send %d bytes...\n", send_at_once);
160 for (; send_at_once; sb++, send_at_once--) { 163 for (; send_at_once; sb++, send_at_once--) {
161 /* set EOF flag before the last word is sent */ 164 /* set EOF flag before the last word is sent */
162 if (send_at_once == 1) 165 if (send_at_once == 1 && last_block)
163 out_8(&psc->ircr2, 0x01); 166 out_8(&psc->ircr2, 0x01);
164 167
165 if (tx_buf) 168 if (tx_buf)