Skip to content

Commit bde83b9

Browse files
neilbrownenomsg
authored andcommitted
bq27x00_battery: Fix bugs introduced with BQ27425 support
commit a66f59b 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 <[email protected]> Cc: Saranya Gopal <[email protected]> Cc: [email protected] Signed-off-by: Anton Vorontsov <[email protected]>
1 parent a05be99 commit bde83b9

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/power/bq27x00_battery.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ static void bq27x00_update(struct bq27x00_device_info *di)
448448
cache.temperature = bq27x00_battery_read_temperature(di);
449449
if (!is_bq27425)
450450
cache.cycle_count = bq27x00_battery_read_cyct(di);
451-
cache.cycle_count = bq27x00_battery_read_cyct(di);
452451
cache.power_avg =
453452
bq27x00_battery_read_pwr_avg(di, BQ27x00_POWER_AVG);
454453

@@ -696,7 +695,6 @@ static int bq27x00_powersupply_init(struct bq27x00_device_info *di)
696695
int ret;
697696

698697
di->bat.type = POWER_SUPPLY_TYPE_BATTERY;
699-
di->chip = BQ27425;
700698
if (di->chip == BQ27425) {
701699
di->bat.properties = bq27425_battery_props;
702700
di->bat.num_properties = ARRAY_SIZE(bq27425_battery_props);

0 commit comments

Comments
 (0)