Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328630
b: refs/heads/master
c: f13639d
h: refs/heads/master
v: v3
  • Loading branch information
Marek Vasut authored and Mark Brown committed Sep 5, 2012
1 parent c778b43 commit 120cd1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 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: 727c10e3e54c4404f6842d246b15fe3703d33556
refs/heads/master: f13639dc6043eb67e308aa5cf96717a86c10f8b9
20 changes: 9 additions & 11 deletions trunk/drivers/spi/spi-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,25 +177,23 @@ static inline void mxs_spi_disable(struct mxs_spi *spi)

static int mxs_ssp_wait(struct mxs_spi *spi, int offset, int mask, bool set)
{
unsigned long timeout = jiffies + msecs_to_jiffies(SSP_TIMEOUT);
const unsigned long timeout = jiffies + msecs_to_jiffies(SSP_TIMEOUT);
struct mxs_ssp *ssp = &spi->ssp;
uint32_t reg;

while (1) {
do {
reg = readl_relaxed(ssp->base + offset);

if (set && ((reg & mask) == mask))
break;
if (!set)
reg = ~reg;

if (!set && ((~reg & mask) == mask))
break;
reg &= mask;

udelay(1);
if (reg == mask)
return 0;
} while (time_before(jiffies, timeout));

if (time_after(jiffies, timeout))
return -ETIMEDOUT;
}
return 0;
return -ETIMEDOUT;
}

static void mxs_ssp_dma_irq_callback(void *param)
Expand Down

0 comments on commit 120cd1e

Please sign in to comment.