summaryrefslogtreecommitdiff
path: root/drivers/power/sbs-battery.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-10-09 17:14:32 (GMT)
committerDavid S. Miller <davem@davemloft.net>2012-10-09 17:14:32 (GMT)
commit8dd9117cc7a021ced1c5cf177e2d44dd92b88617 (patch)
treecad990f58f9ec6d400226dda86718fc10781416e /drivers/power/sbs-battery.c
parent16e310ae6ed352c4963b1f2413fcd88fa693eeda (diff)
parent547b1e81afe3119f7daf702cc03b158495535a25 (diff)
downloadlinux-fsl-qoriq-8dd9117cc7a021ced1c5cf177e2d44dd92b88617.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Pulled mainline in order to get the UAPI infrastructure already merged before I pull in David Howells's UAPI trees for networking. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/power/sbs-battery.c')
-rw-r--r--drivers/power/sbs-battery.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/power/sbs-battery.c b/drivers/power/sbs-battery.c
index a65e8f5..4146596 100644
--- a/drivers/power/sbs-battery.c
+++ b/drivers/power/sbs-battery.c
@@ -759,6 +759,16 @@ static int __devinit sbs_probe(struct i2c_client *client,
chip->irq = irq;
skip_gpio:
+ /*
+ * Before we register, we need to make sure we can actually talk
+ * to the battery.
+ */
+ rc = sbs_read_word_data(client, sbs_data[REG_STATUS].addr);
+ if (rc < 0) {
+ dev_err(&client->dev, "%s: Failed to get device status\n",
+ __func__);
+ goto exit_psupply;
+ }
rc = power_supply_register(&client->dev, &chip->power_supply);
if (rc) {