diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-12-03 06:54:45 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-12-03 06:54:45 -0500 |
| commit | c36910c147fd7b129a8f1269c76b9767c99de5cd (patch) | |
| tree | 29403cd341b62581718f6b34944271980fb133e6 /drivers/spi/mpc52xx_psc_spi.c | |
| parent | 70d7d357578245f1993fd2d3ccd26088bcd38941 (diff) | |
| parent | 09ee17eb8ea89514c13980c4010bdbbaea8630c2 (diff) | |
Merge branch 'iommu-fixes-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent
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 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) |
