regmap: Use flexible sleep
The multi-reg write function uses udelay(), which is a busy-loop based delaying function that is not suitable for a long delays. Hence let's replace the udelay() with fsleep(), which is flexible sleep function that selects best delay function based on the delay-time. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20200830185356.5365-3-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
		
							parent
							
								
									7f9fb67358
								
							
						
					
					
						commit
						2b32d2f7ce
					
				| @ -2231,7 +2231,7 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map, | |||||||
| 					return ret; | 					return ret; | ||||||
| 
 | 
 | ||||||
| 				if (regs[i].delay_us) | 				if (regs[i].delay_us) | ||||||
| 					udelay(regs[i].delay_us); | 					fsleep(regs[i].delay_us); | ||||||
| 
 | 
 | ||||||
| 				base += n; | 				base += n; | ||||||
| 				n = 0; | 				n = 0; | ||||||
| @ -2268,7 +2268,7 @@ static int _regmap_multi_reg_write(struct regmap *map, | |||||||
| 				return ret; | 				return ret; | ||||||
| 
 | 
 | ||||||
| 			if (regs[i].delay_us) | 			if (regs[i].delay_us) | ||||||
| 				udelay(regs[i].delay_us); | 				fsleep(regs[i].delay_us); | ||||||
| 		} | 		} | ||||||
| 		return 0; | 		return 0; | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user