Skip to content

Commit

Permalink
staging:iio:adxrs450: Use usleep_range for the sequential transfer dealy
Browse files Browse the repository at this point in the history
The adxrs450 requires a delay of at least 0.1 ms between register writes.  Using
msleep() for such small delays is not recommended. So use usleep_range instead.

Fixes the following checkpatch warning:
	WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
	+	msleep(1);

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 Feb 2, 2013
1 parent 457b71d commit 619036e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/gyro/adxrs450_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int adxrs450_spi_write_reg_16(struct iio_dev *indio_dev,
if (ret)
dev_err(&st->us->dev, "problem while writing 16 bit register 0x%02x\n",
reg_address);
msleep(1); /* enforce sequential transfer delay 0.1ms */
usleep_range(100, 1000); /* enforce sequential transfer delay 0.1ms */
mutex_unlock(&st->buf_lock);
return ret;
}
Expand Down

0 comments on commit 619036e

Please sign in to comment.