diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-omap2-mcspi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 893c3d78e426..61eef47ae821 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c | |||
@@ -285,8 +285,12 @@ static int mcspi_wait_for_reg_bit(void __iomem *reg, unsigned long bit) | |||
285 | 285 | ||
286 | timeout = jiffies + msecs_to_jiffies(1000); | 286 | timeout = jiffies + msecs_to_jiffies(1000); |
287 | while (!(__raw_readl(reg) & bit)) { | 287 | while (!(__raw_readl(reg) & bit)) { |
288 | if (time_after(jiffies, timeout)) | 288 | if (time_after(jiffies, timeout)) { |
289 | return -1; | 289 | if (!(__raw_readl(reg) & bit)) |
290 | return -ETIMEDOUT; | ||
291 | else | ||
292 | return 0; | ||
293 | } | ||
290 | cpu_relax(); | 294 | cpu_relax(); |
291 | } | 295 | } |
292 | return 0; | 296 | return 0; |