OSDN Git Service

staging: comedi: me4000: usleep_range is preferred over udelay
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 5 Aug 2015 17:45:20 +0000 (10:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 22:03:31 +0000 (15:03 -0700)
Fix checkpatch issue: "CHECK: usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt".  `udelay()` is only used in the
firmware upload process.  Replace them with `usleep_range()` with a
reasonable upper limit.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/me4000.c

index 3974f59..74c16db 100644 (file)
@@ -345,7 +345,7 @@ static int me4000_xilinx_download(struct comedi_device *dev,
        inb(xilinx_iobase + 0xC8);
 
        /* Wait until /INIT pin is set */
-       udelay(20);
+       usleep_range(20, 1000);
        val = inl(devpriv->plx_regbase + PLX9052_INTCSR);
        if (!(val & PLX9052_INTCSR_LI2STAT)) {
                dev_err(dev->class_dev, "Can't init Xilinx\n");
@@ -362,11 +362,11 @@ static int me4000_xilinx_download(struct comedi_device *dev,
                      (((unsigned int)data[1] & 0xff) << 16) +
                      (((unsigned int)data[2] & 0xff) << 8) +
                      ((unsigned int)data[3] & 0xff);
-       udelay(10);
+       usleep_range(10, 1000);
 
        for (i = 0; i < file_length; i++) {
                outb(data[16 + i], xilinx_iobase);
-               udelay(10);
+               usleep_range(10, 1000);
 
                /* Check if BUSY flag is low */
                val = inl(devpriv->plx_regbase + PLX9052_CNTRL);