diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-15 07:41:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-15 07:41:27 +0200 |
commit | c362495586e8a3a6487a318fcd82eaf15ffe2142 (patch) | |
tree | 86f7b195d36ba198f24f86be327f21a8d24ec248 /drivers/power/da9052-battery.c | |
parent | tty: serial: sccnxp: Fix bug with unterminated platform_id list (diff) | |
parent | Linux 3.7-rc1 (diff) | |
download | linux-c362495586e8a3a6487a318fcd82eaf15ffe2142.tar.xz linux-c362495586e8a3a6487a318fcd82eaf15ffe2142.zip |
Merge 3.7-rc1 into tty-linus
This syncs up the tty-linus branch to the latest in Linus's tree to get all of
the UAPI stuff needed for the next set of patches to merge.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/power/da9052-battery.c')
-rw-r--r-- | drivers/power/da9052-battery.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/power/da9052-battery.c b/drivers/power/da9052-battery.c index a5f6a0ec1572..d9d034d7496f 100644 --- a/drivers/power/da9052-battery.c +++ b/drivers/power/da9052-battery.c @@ -327,7 +327,7 @@ static int da9052_bat_interpolate(int vbat_lower, int vbat_upper, return tmp; } -unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp) +static unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp) { int i; @@ -345,6 +345,13 @@ unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp) && (adc_temp <= vc_tbl_ref[i])) return i + 1; } + /* + * For some reason authors of the driver didn't presume that we can + * end up here. It might be OK, but might be not, no one knows for + * sure. Go check your battery, is it on fire? + */ + WARN_ON(1); + return 0; } static int da9052_bat_read_capacity(struct da9052_battery *bat, int *capacity) @@ -616,7 +623,7 @@ static s32 __devinit da9052_bat_probe(struct platform_device *pdev) return 0; err: - for (; i >= 0; i--) { + while (--i >= 0) { irq = platform_get_irq_byname(pdev, da9052_bat_irqs[i]); free_irq(bat->da9052->irq_base + irq, bat); } |