power: bq24735-charger: Assume not charging when charger is missing
authorPaul Kocialkowski <contact@paulk.fr>
Sun, 28 Aug 2016 17:34:46 +0000 (19:34 +0200)
committerSebastian Reichel <sre@kernel.org>
Mon, 29 Aug 2016 00:39:06 +0000 (02:39 +0200)
commitae0f74be6e3db97b23f33be2219044576525176a
tree8fb85232216a9baa4e10ef53afa3d81aab079319
parent1c4593edbd4a893691fa826c36e71946a5d54c1d
power: bq24735-charger: Assume not charging when charger is missing

When the charger is missing (disconnected), it is safe to assume that
the charger chip is no charging.

This is especially relevant when a status GPIO is present and the
charger is getting disconnected. bq24735_charger_is_charging will be
triggered due to the interrupt then, it will attempt to read whether it
is charging through i2c, which will fail as the charger is disconnected.

This also fixes that specific issue.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/bq24735-charger.c