usb: renesas_usbhs: remove redundant polling in usbhsf_fifo_barrier()
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 6 Dec 2017 08:18:31 +0000 (17:18 +0900)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 12 Dec 2017 11:04:07 +0000 (13:04 +0200)
The datasheet doesn't mention that needs to poll of FRDY is set or not.
So, this patch removes such handling in the usbhsf_fifo_barrier().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/renesas_usbhs/fifo.c

index 2d24ef3076ef111a10a95b0e612a186998085527..ff96c2eabcf8d2ee0dd9f0427f5d2e580ea63375 100644 (file)
@@ -256,15 +256,9 @@ static void usbhsf_send_terminator(struct usbhs_pipe *pipe,
 static int usbhsf_fifo_barrier(struct usbhs_priv *priv,
                               struct usbhs_fifo *fifo)
 {
-       int timeout = 1024;
-
-       do {
-               /* The FIFO port is accessible */
-               if (usbhs_read(priv, fifo->ctr) & FRDY)
-                       return 0;
-
-               udelay(10);
-       } while (timeout--);
+       /* The FIFO port is accessible */
+       if (usbhs_read(priv, fifo->ctr) & FRDY)
+               return 0;
 
        return -EBUSY;
 }
@@ -278,8 +272,8 @@ static void usbhsf_fifo_clear(struct usbhs_pipe *pipe,
        if (!usbhs_pipe_is_dcp(pipe)) {
                /*
                 * This driver checks the pipe condition first to avoid -EBUSY
-                * from usbhsf_fifo_barrier() with about 10 msec delay in
-                * the interrupt handler if the pipe is RX direction and empty.
+                * from usbhsf_fifo_barrier() if the pipe is RX direction and
+                * empty.
                 */
                if (usbhs_pipe_is_dir_in(pipe))
                        ret = usbhs_pipe_is_accessible(pipe);