diff options
-rw-r--r-- | drivers/spi/spi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 5787b723b593..42f3e1cb9212 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -1034,8 +1034,14 @@ static int spi_transfer_one_message(struct spi_master *master, | |||
1034 | if (msg->status != -EINPROGRESS) | 1034 | if (msg->status != -EINPROGRESS) |
1035 | goto out; | 1035 | goto out; |
1036 | 1036 | ||
1037 | if (xfer->delay_usecs) | 1037 | if (xfer->delay_usecs) { |
1038 | udelay(xfer->delay_usecs); | 1038 | u16 us = xfer->delay_usecs; |
1039 | |||
1040 | if (us <= 10) | ||
1041 | udelay(us); | ||
1042 | else | ||
1043 | usleep_range(us, us + DIV_ROUND_UP(us, 10)); | ||
1044 | } | ||
1039 | 1045 | ||
1040 | if (xfer->cs_change) { | 1046 | if (xfer->cs_change) { |
1041 | if (list_is_last(&xfer->transfer_list, | 1047 | if (list_is_last(&xfer->transfer_list, |