OSDN Git Service

staging: comedi: adq12b: usleep_range is preferred over udelay
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 9 Oct 2015 18:53:49 +0000 (11:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 06:32:46 +0000 (23:32 -0700)
Fix checkpatch.pl issue:

CHECK: usleep_range is preferred over udelay; see
       Documentation/timers/timers-howto.txt

Replace the udelay() 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/adq12b.c

index dbb9d58..3150504 100644 (file)
@@ -129,7 +129,7 @@ static int adq12b_ai_insn_read(struct comedi_device *dev,
        if (val != devpriv->last_ctreg) {
                outb(val, dev->iobase + ADQ12B_CTREG);
                devpriv->last_ctreg = val;
-               udelay(50);     /* wait for the mux to settle */
+               usleep_range(50, 100);  /* wait for the mux to settle */
        }
 
        val = inb(dev->iobase + ADQ12B_ADLOW);  /* trigger A/D */