Skip to content

Commit

Permalink
spi/dw_spi: remove conditional from 'poll_transfer'.
Browse files Browse the repository at this point in the history
The 'poll_transfer' function employs a conditional to test whether the
transmit buffer is valid; in doing so, on a receive operation no data is
clocked out, thus no data is clocked in and ultimately errors appear.

This removes the conditional as the transmit function will be set to a null
writer when the transmit buffer is invalid, allowing the driver to clock
0x00 out to the device to receive data from the device.

Signed-off-by: George Shore <george@georgeshore.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
George Shore authored and Grant Likely committed Jan 21, 2010
1 parent 426c009 commit f4aec79
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/spi/dw_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,9 @@ static irqreturn_t dw_spi_irq(int irq, void *dev_id)
/* Must be called inside pump_transfers() */
static void poll_transfer(struct dw_spi *dws)
{
if (dws->tx) {
while (dws->write(dws))
dws->read(dws);
}
while (dws->write(dws))
dws->read(dws);

dws->read(dws);
transfer_complete(dws);
}

Expand Down

0 comments on commit f4aec79

Please sign in to comment.