[PATCH 1/1] staging: comedi: dt2815: usleep_range is preferred over udelay

Ian Abbott abbotti at mev.co.uk
Fri Feb 10 15:19:36 UTC 2017


On 09/02/17 15:04, Saber Rezvani wrote:
> Fix the checkpatch.pl issue:
> CHECK: usleep_range is preferred over udelay
>
> Signed-off-by: Saber Rezvani <irsaber at gmail.com>
> ---
>  drivers/staging/comedi/drivers/dt2815.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c
> index 0be77cc..ce55719 100644
> --- a/drivers/staging/comedi/drivers/dt2815.c
> +++ b/drivers/staging/comedi/drivers/dt2815.c
> @@ -188,7 +188,7 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  		/* This is incredibly slow (approx 20 ms) */
>  		unsigned int status;
>
> -		udelay(1000);
> +		usleep_range(1000, 3000);
>  		status = inb(dev->iobase + DT2815_STATUS);
>  		if (status == 4) {
>  			unsigned int program;
>

It looks fine, thanks!  (Perhaps 'msleep(1);' would be better, although 
that might make the "incredibly slow" attach even slower if no hrtimer 
is available.)

Reviewed-by: Ian Abbott <abbotti at mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-


More information about the devel mailing list