Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106931
b: refs/heads/master
c: 9a7867e
h: refs/heads/master
i:
  106929: 2042ab6
  106927: aee26dd
v: v3
  • Loading branch information
Luotao Fu authored and Linus Torvalds committed Jul 28, 2008
1 parent ff3c666 commit dfd4dfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 78a34ae29bf1c9df62a5bd0f0798b6c62a54d520
refs/heads/master: 9a7867e1b34c3575e7e76a05c0c54c6edbdae2a4
22 changes: 7 additions & 15 deletions trunk/drivers/spi/mpc52xx_psc_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
unsigned rfalarm;
unsigned send_at_once = MPC52xx_PSC_BUFSIZE;
unsigned recv_at_once;
unsigned bpw = mps->bits_per_word / 8;

if (!t->tx_buf && !t->rx_buf && t->len)
return -EINVAL;
Expand All @@ -164,22 +163,15 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
}

dev_dbg(&spi->dev, "send %d bytes...\n", send_at_once);
if (tx_buf) {
for (; send_at_once; sb++, send_at_once--) {
/* set EOF flag */
if (mps->bits_per_word
&& (sb + 1) % bpw == 0)
out_8(&psc->ircr2, 0x01);
for (; send_at_once; sb++, send_at_once--) {
/* set EOF flag before the last word is sent */
if (send_at_once == 1)
out_8(&psc->ircr2, 0x01);

if (tx_buf)
out_8(&psc->mpc52xx_psc_buffer_8, tx_buf[sb]);
}
} else {
for (; send_at_once; sb++, send_at_once--) {
/* set EOF flag */
if (mps->bits_per_word
&& ((sb + 1) % bpw) == 0)
out_8(&psc->ircr2, 0x01);
else
out_8(&psc->mpc52xx_psc_buffer_8, 0);
}
}


Expand Down

0 comments on commit dfd4dfc

Please sign in to comment.