diff options
author | NeilBrown <neilb@suse.de> | 2012-12-02 04:34:21 -0500 |
---|---|---|
committer | Anton Vorontsov <anton@enomsg.org> | 2013-01-05 21:53:28 -0500 |
commit | bde83b9a6b44c1e0fd872e57ecc869cfcf88538f (patch) | |
tree | de603fcd6bbf7d79b889d731db252626e3b35257 /drivers/power/bq27x00_battery.c | |
parent | a05be99174edc9f258ee68140b71b9645ad977ee (diff) |
bq27x00_battery: Fix bugs introduced with BQ27425 support
commit a66f59ba2e994bf70274ef0513e24e0e7ae20c63
bq27x00_battery: Add support for BQ27425 chip
introduced 2 bugs.
1/ 'chip' was set to BQ27425 unconditionally - breaking support for
other devices;
2/ BQ27425 does not support cycle count, how the code still tries to
get the cycle count for BQ27425, and now does it twice for other chips.
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Saranya Gopal <saranya.gopal@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power/bq27x00_battery.c')
-rw-r--r-- | drivers/power/bq27x00_battery.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c index 36b34efdafc9..7087d0d6a087 100644 --- a/drivers/power/bq27x00_battery.c +++ b/drivers/power/bq27x00_battery.c | |||
@@ -448,7 +448,6 @@ static void bq27x00_update(struct bq27x00_device_info *di) | |||
448 | cache.temperature = bq27x00_battery_read_temperature(di); | 448 | cache.temperature = bq27x00_battery_read_temperature(di); |
449 | if (!is_bq27425) | 449 | if (!is_bq27425) |
450 | cache.cycle_count = bq27x00_battery_read_cyct(di); | 450 | cache.cycle_count = bq27x00_battery_read_cyct(di); |
451 | cache.cycle_count = bq27x00_battery_read_cyct(di); | ||
452 | cache.power_avg = | 451 | cache.power_avg = |
453 | bq27x00_battery_read_pwr_avg(di, BQ27x00_POWER_AVG); | 452 | bq27x00_battery_read_pwr_avg(di, BQ27x00_POWER_AVG); |
454 | 453 | ||
@@ -696,7 +695,6 @@ static int bq27x00_powersupply_init(struct bq27x00_device_info *di) | |||
696 | int ret; | 695 | int ret; |
697 | 696 | ||
698 | di->bat.type = POWER_SUPPLY_TYPE_BATTERY; | 697 | di->bat.type = POWER_SUPPLY_TYPE_BATTERY; |
699 | di->chip = BQ27425; | ||
700 | if (di->chip == BQ27425) { | 698 | if (di->chip == BQ27425) { |
701 | di->bat.properties = bq27425_battery_props; | 699 | di->bat.properties = bq27425_battery_props; |
702 | di->bat.num_properties = ARRAY_SIZE(bq27425_battery_props); | 700 | di->bat.num_properties = ARRAY_SIZE(bq27425_battery_props); |