staging: comedi: rtd529: usleep_range is preferred over udelay
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 25 Sep 2015 00:52:03 +0000 (17:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 01:32:21 +0000 (03:32 +0200)
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/rtd520.c

index ea594e675b6ec93b75b55bc6f74d05b83529fd6e..49cbf48d1497bd33924ea7de31ff29117445a89d 100644 (file)
@@ -513,7 +513,7 @@ static int rtd520_probe_fifo_depth(struct comedi_device *dev)
                unsigned fifo_status;
                /* trigger conversion */
                writew(0, dev->mmio + LAS0_ADC);
-               udelay(1);
+               usleep_range(1, 1000);
                fifo_status = readl(dev->mmio + LAS0_ADC);
                if ((fifo_status & FS_ADC_HEMPTY) == 0) {
                        fifo_size = 2 * i;
@@ -1142,7 +1142,7 @@ static void rtd_reset(struct comedi_device *dev)
        struct rtd_private *devpriv = dev->private;
 
        writel(0, dev->mmio + LAS0_BOARD_RESET);
-       udelay(100);            /* needed? */
+       usleep_range(100, 1000);        /* needed? */
        writel(0, devpriv->lcfg + PLX_INTRCS_REG);
        writew(0, dev->mmio + LAS0_IT);
        writew(~0, dev->mmio + LAS0_CLEAR);