regulator: Ensure enough delay time for enabling regulator
PATCH v2 2/3 regulator: Ensure enough delay time for enabling regulator
Integer division will truncate the result, this patch ensures we have enough delay time for enabling regulator.
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/core.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/regulator/core.c +4 -2
@@ -1312,10 +1312,12 @@ 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 ) { printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",
Signature · 1 line
1.7.0.4
Quoted 4 lines · Axel Lin
Integer division will truncate the result, this patch ensures we have enough delay time for enabling regulator.
Signed-off-by Axel Lin <[email protected]>
Acked-by Mark Brown <[email protected]>
Quoted 7 lines · Mark Brown
Quoted 4 lines · Axel Lin
Integer division will truncate the result, this patch ensures we have enough delay time for enabling regulator.
Signed-off-by Axel Lin <[email protected]>Acked-by Mark Brown <[email protected]>
All applied.
Thanks
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk