diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-07 08:29:24 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-07 08:29:24 (GMT) |
commit | e665faa424a4a782aa986274920c1fc5b76f5560 (patch) | |
tree | 2cf64abadecbbeadcffc02cb7671cb593fc45488 /drivers/power/da9052-battery.c | |
parent | ca4da6948bc6a7010ecf916dad528c177dcb9a81 (diff) | |
parent | 18766f0936d444fd7ff2e0064bd6e69a89d5c6fc (diff) | |
download | linux-e665faa424a4a782aa986274920c1fc5b76f5560.tar.xz |
Merge tag 'for-v3.7' of git://git.infradead.org/battery-2.6
Pull battery updates from Anton Vorontsov:
"1. New drivers:
- Marvell 88pm860x charger and battery drivers;
- Texas Instruments LP8788 charger driver;
2. Two new power supply properties: whether a battery is authentic,
and chargers' maximal currents and voltages;
3. A lot of TI LP8727 Charger cleanups;
4. New features for Charger Manager, mainly now we can disable
specific regulators;
5. Random fixes and cleanups for other drivers."
Fix up trivial conflicts in <linux/mfd/88pm860x.h>
* tag 'for-v3.7' of git://git.infradead.org/battery-2.6: (52 commits)
pda_power: Remove ac_draw_failed goto and label
charger-manager: Add support sysfs entry for charger
charger-manager: Support limit of maximum possible
charger-manager: Check fully charged state of battery periodically
lp8727_charger: More pure cosmetic improvements
lp8727_charger: Fix checkpatch warning
lp8727_charger: Add description in the private data
lp8727_charger: Fix a typo - chg_parm to chg_param
lp8727_charger: Make some cosmetic changes in lp8727_delayed_func()
lp8727_charger: Clean up lp8727_charger_changed()
lp8727_charger: Return if the battery is discharging
lp8727_charger: Make lp8727_charger_get_propery() simpler
lp8727_charger: Make lp8727_ctrl_switch() inline
lp8727_charger: Make lp8727_init_device() shorter
lp8727_charger: Clean up lp8727_is_charger_attached()
lp8727_charger: Use specific definition
lp8727_charger: Clean up lp8727 definitions
lp8727_charger: Use the definition rather than enum
lp8727_charger: Fix code for getting battery temp
lp8727_charger: Clear interrrupts at inital time
...
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 a5f6a0e..d9d034d 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); } |