From: Sunny Kumar Date: Tue, 7 Jul 2015 06:57:03 +0000 (+0530) Subject: usb: usleep_range is preferred over udelay where wakeup is flexible X-Git-Tag: firefly_0821_release~176^2~1219^2~63 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=e616b39a16d4458224d91697b0a2599336f0c38c;p=firefly-linux-kernel-4.4.55.git usb: usleep_range is preferred over udelay where wakeup is flexible According to Documentation/timers/timers-howto.txt" udelay() is only called once from a place where sleeping is allowed. We can replace it with a call to usleep_range() with a reasonable upper limit. Signed-off-by: Sunny Kumar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 540add24a12f..5e67f63b2e46 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -1111,7 +1111,7 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us) * command phase and the data phase. Some devices need a little * more than that, probably because of clock rate inaccuracies. */ if (unlikely(us->fflags & US_FL_GO_SLOW)) - udelay(125); + usleep_range(125, 150); if (transfer_length) { unsigned int pipe = srb->sc_data_direction == DMA_FROM_DEVICE ?