diff options
author | Eva Rachel Retuya <eraretuya@gmail.com> | 2015-10-25 01:24:51 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-26 04:09:16 +0900 |
commit | c75e057744fb16d00668674cf41d63b61ee3cd2d (patch) | |
tree | 2640fe9df5d28164f4138f0d89f1cc3ff236f0f0 | |
parent | d6a0692befc1b85dc2e5408e90e51452a6533f47 (diff) | |
download | linux-c75e057744fb16d00668674cf41d63b61ee3cd2d.tar.bz2 |
Staging: mt29f_spinand: Replace udelay function with usleep_range
Use 'usleep_range' instead of 'udelay' to elapse time. For
spinand_reset, define the upper limit by a factor of 2 to keep the wait
short while still allowing a "good enough" range for wakeup. Define the
range 250us - 1ms for spinand_cmdfunc to provide enough leeway before
issuing spinand_reset. Checkpatch found this issue.
CHECK: usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt
Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/mt29f_spinand/mt29f_spinand.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c index a8292a1a8e41..b6a1ffca0a3f 100644 --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c @@ -736,7 +736,7 @@ static void spinand_reset(struct spi_device *spi_nand) pr_info("spinand reset failed!\n"); /* elapse 1ms before issuing any other command */ - udelay(1000); + usleep_range(1000, 2000); if (wait_till_ready(spi_nand)) dev_err(&spi_nand->dev, "wait timedout!\n"); @@ -802,7 +802,7 @@ static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command, if (wait_till_ready(info->spi)) dev_err(&info->spi->dev, "WAIT timedout!!!\n"); /* a minimum of 250us must elapse before issuing RESET cmd*/ - udelay(250); + usleep_range(250, 1000); spinand_reset(info->spi); break; default: |