]> git.baikalelectronics.ru Git - kernel.git/commit
sbs-battery: Probe should try talking to the device
authorOlof Johansson <olof@lixom.net>
Thu, 6 Sep 2012 18:32:29 +0000 (11:32 -0700)
committerAnton Vorontsov <anton.vorontsov@linaro.org>
Thu, 20 Sep 2012 21:57:52 +0000 (14:57 -0700)
commitf6e4d1f7415ca356203bf7e782784bb41a1f42df
treeb63c1392dd28c602bc26cc8075f466a4077f5064
parent1f222f824175584c91bf55428d372687c173656b
sbs-battery: Probe should try talking to the device

Turns out this driver doesn't actually try talking to the device at
probe time, so if it's incorrectly configured in the device tree or
platform data (or if the battery has been removed from the system),
then probe will succeed and every access will sit there and time out.
The end result is a possibly laggy system that thinks it has a battery
but can never read status, which isn't very useful.

Instead, just read any register (I chose status) at probe, and if that
fails, don't register the device.

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
drivers/power/sbs-battery.c