diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2016-05-19 21:15:27 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-18 06:57:54 +0300 |
commit | cda2315000d257fb169e8e15675b667264634a74 (patch) | |
tree | 646433a1e7026a44f5e1cde4feed8ef5132f3c39 /drivers/staging/comedi | |
parent | 0ef613473f8902708f7ea75d63e5dadb7c4a988c (diff) | |
download | linux-cda2315000d257fb169e8e15675b667264634a74.tar.xz |
staging: comedi: daqboard2000: prefer usleep_range()
The checkpatch.pl warns about two `udelay(x)` calls, one of 100
microseconds, and one of 10 microseconds. The 100 microseconds one is
used when waiting for FPGA to become ready to accept firmware, and is
not that critical, so replace it with a call to `usleep_range(100,
1000)`. The 10 microseconds one is called as each 16-bit word of
firmware data is written. Replace it with a fairly tight
`usleep_range(10, 20)` to avoid slowing down firmware loading too much.
The firmware is fairly short, so this would only slow it down firmware
loading by about 20 milliseconds or so.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/daqboard2000.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c index 6bc5bfefc41b..65daef0c00d5 100644 --- a/drivers/staging/comedi/drivers/daqboard2000.c +++ b/drivers/staging/comedi/drivers/daqboard2000.c @@ -476,7 +476,7 @@ static int daqboard2000_poll_cpld(struct comedi_device *dev, int mask) result = 1; break; } - udelay(100); + usleep_range(100, 1000); } udelay(5); return result; @@ -486,7 +486,7 @@ static int daqboard2000_write_cpld(struct comedi_device *dev, int data) { int result = 0; - udelay(10); + usleep_range(10, 20); writew(data, dev->mmio + 0x1000); if ((readw(dev->mmio + 0x1000) & DAQBOARD2000_CPLD_INIT) == DAQBOARD2000_CPLD_INIT) { |