The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Saranya Gopal <saranya.gopal@intel.com>,
	David Woodhouse <dwmw2@infradead.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] bq27x00_battery: fix bugs introduced with BQ27425 support
Date: Sun, 2 Dec 2012 20:34:21 +1100	[thread overview]
Message-ID: <20121202203421.1ad1f6dc@notabene.brown> (raw)

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]



commit a66f59ba2e994bf70274ef0513e24e0e7ae20c63
    bq27x00_battery: Add support for BQ27425 chip

introduced 2 bug.

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.

Cc: Saranya Gopal <saranya.gopal@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
index e2659f1..51d4017 100644
--- a/drivers/power/bq27x00_battery.c
+++ b/drivers/power/bq27x00_battery.c
@@ -445,7 +445,6 @@ static void bq27x00_update(struct bq27x00_device_info *di)
 		cache.temperature = bq27x00_battery_read_temperature(di);
 		if (!is_bq27425)
 			cache.cycle_count = bq27x00_battery_read_cyct(di);
-		cache.cycle_count = bq27x00_battery_read_cyct(di);
 		cache.power_avg =
 			bq27x00_battery_read_pwr_avg(di, BQ27x00_POWER_AVG);
 
@@ -697,7 +696,6 @@ static int bq27x00_powersupply_init(struct bq27x00_device_info *di)
 	int ret;
 
 	di->bat.type = POWER_SUPPLY_TYPE_BATTERY;
-	di->chip = BQ27425;
 	if (di->chip == BQ27425) {
 		di->bat.properties = bq27425_battery_props;
 		di->bat.num_properties = ARRAY_SIZE(bq27425_battery_props);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

             reply	other threads:[~2012-12-02  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-02  9:34 NeilBrown [this message]
2013-01-06  2:59 ` [PATCH] bq27x00_battery: fix bugs introduced with BQ27425 support Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121202203421.1ad1f6dc@notabene.brown \
    --to=neilb@suse.de \
    --cc=anton.vorontsov@linaro.org \
    --cc=dwmw2@infradead.org \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saranya.gopal@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox