Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150394
b: refs/heads/master
c: 210dd1b
h: refs/heads/master
v: v3
  • Loading branch information
Max Filippov authored and John W. Linville committed May 20, 2009
1 parent 92f20d9 commit 4225edd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 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: 4eaf16bc1f92bf772f6d42860e86b399d00b7b94
refs/heads/master: 210dd1bb9b0329bcc1b4f8932022eddc6466980c
8 changes: 3 additions & 5 deletions trunk/drivers/net/wireless/p54/p54spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,23 @@ static int p54spi_wait_bit(struct p54s_priv *priv, u16 reg, __le32 bits)
__le32 buffer = p54spi_read32(priv, reg);
if ((buffer & bits) == bits)
return 1;

msleep(0);
}
return 0;
}

static int p54spi_spi_write_dma(struct p54s_priv *priv, __le32 base,
const void *buf, size_t len)
{
p54spi_write16(priv, SPI_ADRS_DMA_WRITE_CTRL,
cpu_to_le16(SPI_DMA_WRITE_CTRL_ENABLE));

if (!p54spi_wait_bit(priv, SPI_ADRS_DMA_WRITE_CTRL,
cpu_to_le32(HOST_ALLOWED))) {
dev_err(&priv->spi->dev, "spi_write_dma not allowed "
"to DMA write.\n");
return -EAGAIN;
}

p54spi_write16(priv, SPI_ADRS_DMA_WRITE_CTRL,
cpu_to_le16(SPI_DMA_WRITE_CTRL_ENABLE));

p54spi_write16(priv, SPI_ADRS_DMA_WRITE_LEN, cpu_to_le16(len));
p54spi_write32(priv, SPI_ADRS_DMA_WRITE_BASE, base);
p54spi_spi_write(priv, SPI_ADRS_DMA_DATA, buf, len);
Expand Down

0 comments on commit 4225edd

Please sign in to comment.