regulator: max8998: Ensure enough delay time for max8998_set_voltage_buck_time_sel
commit 81d0a6ae7b upstream.
Use DIV_ROUND_UP to prevent truncation by integer division issue.
This ensures we return enough delay time.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
[bwh: Backported to 3.2: delay is done by driver, not returned to the caller]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
@ -497,7 +497,7 @@ buck2_exit:
|
||||
|
||||
difference = desc->min + desc->step*i - previous_vol/1000;
|
||||
if (difference > 0)
|
||||
udelay(difference / ((val & 0x0f) + 1));
|
||||
udelay(DIV_ROUND_UP(difference, (val & 0x0f) + 1));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user