aboutsummaryrefslogtreecommitdiff
path: root/lib/flex_array.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2012-12-28 17:09:03 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-07 16:02:07 -0700
commitcd858528541c10bb879436da8fce44e0c9c85b97 (patch)
tree1e5c73e7fd5c31c7c6efb860ca92dbf6ed5754c3 /lib/flex_array.c
parentc7e0950c2d360599d5b859ff43caf142115ac518 (diff)
regulator: max8997: Use uV in voltage_map_desc
commit bc3b7756b5ff66828acf7bc24f148d28b8d61108 upstream. Current code does integer division (min_vol = min_uV / 1000) before pass min_vol to max8997_get_voltage_proper_val(). So it is possible min_vol is truncated to a smaller value. For example, if the request min_uV is 800900 for ldo. min_vol = 800900 / 1000 = 800 (mV) Then max8997_get_voltage_proper_val returns 800 mV for this case which is lower than the requested voltage. Use uV rather than mV in voltage_map_desc to prevent truncation by integer division. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> [bwh: Backported to 3.2: - Adjust context - voltage_map_desc also has an n_bits field] Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: Qiang Huang <h.huangqiang@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/flex_array.c')
0 files changed, 0 insertions, 0 deletions