diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-12-06 04:48:49 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-12-18 03:41:22 -0500 |
commit | cb15da3636b038a9a60354b838cb37d8cab48dfe (patch) | |
tree | 52693d7fac85bb7bf761587deaf3bcadce1f2c69 /drivers/media/radio | |
parent | 9ca33ccd539e67f6042d813146bf1b65605fa5c4 (diff) |
[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 <hans.verkuil@cisco.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Dinesh Ram <dinesh.ram@cern.ch>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r-- | drivers/media/radio/si4713/si4713.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 4c3498f05030..07d5153811e8 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, | |||
252 | 252 | ||
253 | if (client->irq) | 253 | if (client->irq) |
254 | return -EBUSY; | 254 | return -EBUSY; |
255 | msleep(1); | 255 | if (usecs <= 1000) |
256 | } while (jiffies <= until_jiffies); | 256 | usleep_range(usecs, 1000); |
257 | else | ||
258 | usleep_range(1000, 2000); | ||
259 | } while (time_is_after_jiffies(until_jiffies)); | ||
257 | 260 | ||
258 | return -EBUSY; | 261 | return -EBUSY; |
259 | } | 262 | } |
@@ -505,11 +508,11 @@ static int si4713_wait_stc(struct si4713_device *sdev, const int usecs) | |||
505 | } | 508 | } |
506 | if (jiffies_to_usecs(jiffies - start_jiffies) > usecs) | 509 | if (jiffies_to_usecs(jiffies - start_jiffies) > usecs) |
507 | return err < 0 ? err : -EIO; | 510 | return err < 0 ? err : -EIO; |
508 | /* We sleep here for 3 ms in order to avoid flooding the device | 511 | /* We sleep here for 3-4 ms in order to avoid flooding the device |
509 | * with USB requests. The si4713 USB driver was developed | 512 | * with USB requests. The si4713 USB driver was developed |
510 | * by reverse engineering the Windows USB driver. The windows | 513 | * by reverse engineering the Windows USB driver. The windows |
511 | * driver also has a ~2.5 ms delay between responses. */ | 514 | * driver also has a ~2.5 ms delay between responses. */ |
512 | msleep(3); | 515 | usleep_range(3000, 4000); |
513 | } | 516 | } |
514 | } | 517 | } |
515 | 518 | ||