From a45053f211ad523ab63683fd5bdcb02cd84f5467 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 10 Apr 2012 14:22:38 +0800 Subject: [PATCH] --- yaml --- r: 302187 b: refs/heads/master c: 0fa310ccabfe9034017e1b6780052d36fbd9f38f h: refs/heads/master i: 302185: 861cf5b6e899aa7704ef86734c2cee6fc6b971c6 302183: 44cfa43a66eb473717d6664fa106d993a0106566 v: v3 --- [refs] | 2 +- trunk/drivers/regulator/max8997.c | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 5f5004ad604f..1f7a49dfdc43 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 65896e7362670aa9a416d851ec11b7fc009c7e94 +refs/heads/master: 0fa310ccabfe9034017e1b6780052d36fbd9f38f diff --git a/trunk/drivers/regulator/max8997.c b/trunk/drivers/regulator/max8997.c index 48fa966929eb..89c93d891140 100644 --- a/trunk/drivers/regulator/max8997.c +++ b/trunk/drivers/regulator/max8997.c @@ -68,29 +68,28 @@ struct voltage_map_desc { int min; int max; int step; - unsigned int n_bits; }; /* Voltage maps in mV */ static const struct voltage_map_desc ldo_voltage_map_desc = { - .min = 800, .max = 3950, .step = 50, .n_bits = 6, + .min = 800, .max = 3950, .step = 50, }; /* LDO1 ~ 18, 21 all */ static const struct voltage_map_desc buck1245_voltage_map_desc = { - .min = 650, .max = 2225, .step = 25, .n_bits = 6, + .min = 650, .max = 2225, .step = 25, }; /* Buck1, 2, 4, 5 */ static const struct voltage_map_desc buck37_voltage_map_desc = { - .min = 750, .max = 3900, .step = 50, .n_bits = 6, + .min = 750, .max = 3900, .step = 50, }; /* Buck3, 7 */ /* current map in mA */ static const struct voltage_map_desc charger_current_map_desc = { - .min = 200, .max = 950, .step = 50, .n_bits = 4, + .min = 200, .max = 950, .step = 50, }; static const struct voltage_map_desc topoff_current_map_desc = { - .min = 50, .max = 200, .step = 10, .n_bits = 4, + .min = 50, .max = 200, .step = 10, }; static const struct voltage_map_desc *reg_voltage_map[] = { @@ -431,9 +430,6 @@ static inline int max8997_get_voltage_proper_val( if (desc->min + desc->step * i > max_vol) return -EINVAL; - if (i >= (1 << desc->n_bits)) - return -EINVAL; - return i; }