mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-02 09:16:41 +09:00
regulator: Fix the logic to ensure new voltage setting in valid range
commit f55205f4d4 upstream.
I think this is a typo.
To ensure new voltage setting won't greater than desc->max,
the equation should be desc->min + desc->step * new_val <= desc->max.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cb68af469f
commit
efa80b562a
@@ -688,7 +688,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
|
||||
}
|
||||
|
||||
new_val++;
|
||||
} while (desc->min + desc->step + new_val <= desc->max);
|
||||
} while (desc->min + desc->step * new_val <= desc->max);
|
||||
|
||||
new_idx = tmp_idx;
|
||||
new_val = tmp_val;
|
||||
|
||||
Reference in New Issue
Block a user