Skip to content

Commit

Permalink
staging:iio:ad7793: Use usleep_range instead of msleep
Browse files Browse the repository at this point in the history
It is recommended to use usleep_range instead of msleep for durations smaller
than a 20ms.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Nov 30, 2012
1 parent e4ac728 commit 3e4334f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/adc/ad7793.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static int ad7793_setup(struct iio_dev *indio_dev,
ret = spi_write(st->sd.spi, (u8 *)&ret, sizeof(ret));
if (ret < 0)
goto out;
msleep(1); /* Wait for at least 500us */
usleep_range(500, 2000); /* Wait for at least 500us */

/* write/read test for device presence */
ret = ad_sd_read_reg(&st->sd, AD7793_REG_ID, 1, &id);
Expand Down

0 comments on commit 3e4334f

Please sign in to comment.