lkml.org 
[lkml]   [2010]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/3] regulator: Ensure enough delay time for enabling regulator
From
Date
Integer division will truncate the result, this patch ensures we have
enough delay time for enabling regulator.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/core.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 5ee67ba..0dd9a57 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1312,9 +1312,10 @@ static int _regulator_enable(struct regulator_dev *rdev)
if (ret < 0)
return ret;

- if (delay >= 1000)
+ if (delay >= 1000) {
mdelay(delay / 1000);
- else if (delay)
+ udelay(delay % 1000);
+ } else if (delay)
udelay(delay);

} else if (ret < 0) {
--
1.7.2




\
 
 \ /
  Last update: 2010-11-05 08:25    [W:0.028 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site