Commit 13d515c7 authored by Vignesh R's avatar Vignesh R Committed by Mark Brown

spi: omap2-mcspi: Switch to readl_poll_timeout()

Use standard readl_poll_timeout() macro for polling on status bits.
Signed-off-by: default avatarVignesh R <vigneshr@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c530cd1d
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/gcd.h> #include <linux/gcd.h>
#include <linux/iopoll.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/gpio.h> #include <linux/gpio.h>
...@@ -353,19 +354,9 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi, ...@@ -353,19 +354,9 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi,
static int mcspi_wait_for_reg_bit(void __iomem *reg, unsigned long bit) static int mcspi_wait_for_reg_bit(void __iomem *reg, unsigned long bit)
{ {
unsigned long timeout; u32 val;
timeout = jiffies + msecs_to_jiffies(1000); return readl_poll_timeout(reg, val, val & bit, 1, MSEC_PER_SEC);
while (!(readl_relaxed(reg) & bit)) {
if (time_after(jiffies, timeout)) {
if (!(readl_relaxed(reg) & bit))
return -ETIMEDOUT;
else
return 0;
}
cpu_relax();
}
return 0;
} }
static void omap2_mcspi_rx_callback(void *data) static void omap2_mcspi_rx_callback(void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment