]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
spi/dw_spi: bug fix in wait_till_not_busy()
authorFeng Tang <feng.tang@intel.com>
Wed, 20 Jan 2010 20:49:45 +0000 (13:49 -0700)
committerGrant Likely <grant.likely@secretlab.ca>
Wed, 20 Jan 2010 20:49:45 +0000 (13:49 -0700)
Make the driver wait at least  for 1 jiffie before issuing the
warning, no matter what HZ is set to

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/spi/dw_spi.c

index 31620fae77be607a469bbdc7baf3b314921a1ba9..521d680af2897d7e13dfec7df3cca10c9386f42a 100644 (file)
@@ -161,7 +161,7 @@ static inline void mrst_spi_debugfs_remove(struct dw_spi *dws)
 
 static void wait_till_not_busy(struct dw_spi *dws)
 {
-       unsigned long end = jiffies + usecs_to_jiffies(1000);
+       unsigned long end = jiffies + 1 + usecs_to_jiffies(1000);
 
        while (time_before(jiffies, end)) {
                if (!(dw_readw(dws, sr) & SR_BUSY))