From cb15da3636b038a9a60354b838cb37d8cab48dfe Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 6 Dec 2013 06:48:49 -0300 Subject: [PATCH] [media] si4713: coding style time-related cleanups Fix the non-whitespace checkpatch errors/warnings. Replace msleep with usleep_range and the jiffies comparison with time_is_after_jiffies(). Signed-off-by: Hans Verkuil Acked-by: Eduardo Valentin Acked-by: Dinesh Ram Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/si4713/si4713.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 4c3498f..07d5153 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c @@ -252,8 +252,11 @@ static int si4713_send_command(struct si4713_device *sdev, const u8 command, if (client->irq) return -EBUSY; - msleep(1); - } while (jiffies <= until_jiffies); + if (usecs <= 1000) + usleep_range(usecs, 1000); + else + usleep_range(1000, 2000); + } while (time_is_after_jiffies(until_jiffies)); return -EBUSY; } @@ -505,11 +508,11 @@ static int si4713_wait_stc(struct si4713_device *sdev, const int usecs) } if (jiffies_to_usecs(jiffies - start_jiffies) > usecs) return err < 0 ? err : -EIO; - /* We sleep here for 3 ms in order to avoid flooding the device + /* We sleep here for 3-4 ms in order to avoid flooding the device * with USB requests. The si4713 USB driver was developed * by reverse engineering the Windows USB driver. The windows * driver also has a ~2.5 ms delay between responses. */ - msleep(3); + usleep_range(3000, 4000); } } -- 2.7.4