regulator: max8997: Remove n_bits from struct voltage_map_desc
authorAxel Lin <axel.lin@gmail.com>
Tue, 10 Apr 2012 06:22:38 +0000 (14:22 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 10 Apr 2012 09:14:01 +0000 (10:14 +0100)
commit0fa310ccabfe9034017e1b6780052d36fbd9f38f
treead74f575623583ff0269c146f45f7eb59a113930
parent65896e7362670aa9a416d851ec11b7fc009c7e94
regulator: max8997: Remove n_bits from struct voltage_map_desc

The n_bits is only used in max8997_get_voltage_proper_val to check the valid
range for variable i.

Current code already ensures min_vol never greater than desc->max,
which means the variable i always in the valid range:
0 .. (desc->max - desc->min)/desc->step.

Thus we can remove the checking (i >= (1 << desc->n_bits) and then remove
n_bits from struct voltage_map_desc.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/max8997.c