[media] v4l: omap4iss: Replace udelay/msleep with usleep_range
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 3 Dec 2013 19:50:28 +0000 (17:50 -0200)
The only udelay() call takes place in a sleepable context, we can sleep
instead. Use usleep_range().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/media/omap4iss/iss.c

index 320bfd4..3103093 100644 (file)
@@ -642,11 +642,11 @@ static int iss_reset(struct iss_device *iss)
 
        while (readl(iss->regs[OMAP4_ISS_MEM_TOP] + ISS_HL_SYSCONFIG) &
                        ISS_HL_SYSCONFIG_SOFTRESET) {
-               if (timeout++ > 10000) {
+               if (timeout++ > 100) {
                        dev_alert(iss->dev, "cannot reset ISS\n");
                        return -ETIMEDOUT;
                }
-               udelay(1);
+               usleep_range(10, 10);
        }
 
        return 0;
@@ -674,7 +674,7 @@ static int iss_isp_reset(struct iss_device *iss)
                        dev_alert(iss->dev, "cannot set ISP5 to standby\n");
                        return -ETIMEDOUT;
                }
-               msleep(1);
+               usleep_range(1000, 1500);
        }
 
        /* Now finally, do the reset */
@@ -689,7 +689,7 @@ static int iss_isp_reset(struct iss_device *iss)
                        dev_alert(iss->dev, "cannot reset ISP5\n");
                        return -ETIMEDOUT;
                }
-               msleep(1);
+               usleep_range(1000, 1500);
        }
 
        return 0;