bq27x00_battery: Fix bugs introduced with BQ27425 support
authorNeilBrown <neilb@suse.de>
Sun, 2 Dec 2012 09:34:21 +0000 (20:34 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Mar 2013 22:03:38 +0000 (06:03 +0800)
commiteddf61b2363eb515138aa7fd1627c1747f269131
tree5207db0466b30979a4d0c3104cb65378f28ceafd
parentec463f0ca581308b1a46ae4bfbe7faeb8ea3c378
bq27x00_battery: Fix bugs introduced with BQ27425 support

commit bde83b9a6b44c1e0fd872e57ecc869cfcf88538f upstream.

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>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/bq27x00_battery.c