[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>
This commit is contained in:
		
					parent
					
						
							
								9ca33ccd53
							
						
					
				
			
			
				commit
				
					
						cb15da3636
					
				
			
		
					 1 changed files with 7 additions and 4 deletions
				
			
		|  | @ -252,8 +252,11 @@ static int si4713_send_command(struct si4713_device *sdev, const u8 command, | ||||||
| 
 | 
 | ||||||
| 		if (client->irq) | 		if (client->irq) | ||||||
| 			return -EBUSY; | 			return -EBUSY; | ||||||
| 		msleep(1); | 		if (usecs <= 1000) | ||||||
| 	} while (jiffies <= until_jiffies); | 			usleep_range(usecs, 1000); | ||||||
|  | 		else | ||||||
|  | 			usleep_range(1000, 2000); | ||||||
|  | 	} while (time_is_after_jiffies(until_jiffies)); | ||||||
| 
 | 
 | ||||||
| 	return -EBUSY; | 	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) | 		if (jiffies_to_usecs(jiffies - start_jiffies) > usecs) | ||||||
| 			return err < 0 ? err : -EIO; | 			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 | 		 * with USB requests. The si4713 USB driver was developed | ||||||
| 		 * by reverse engineering the Windows USB driver. The windows | 		 * by reverse engineering the Windows USB driver. The windows | ||||||
| 		 * driver also has a ~2.5 ms delay between responses. */ | 		 * driver also has a ~2.5 ms delay between responses. */ | ||||||
| 		msleep(3); | 		usleep_range(3000, 4000); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Hans Verkuil
				Hans Verkuil