summaryrefslogtreecommitdiff
path: root/drivers/power/rx51_battery.c
diff options
context:
space:
mode:
authorMarek Belisko <marek.belisko@open-nandra.com>2013-08-30 17:47:57 -0700
committerAnton Vorontsov <anton@enomsg.org>2013-08-30 17:49:15 -0700
commitdb15e6312efd537e2deb2cbad110c23f98704a3c (patch)
treeb7da54103a78ea1815fa5f2019bbe07d87722654 /drivers/power/rx51_battery.c
parentda0a00ebc239e852a504abfce2ad98957434ae58 (diff)
downloadlwn-db15e6312efd537e2deb2cbad110c23f98704a3c.tar.gz
lwn-db15e6312efd537e2deb2cbad110c23f98704a3c.zip
rx51_battery: Fix channel number when reading adc value
This issue was introduced in commit 8e2747f031bd "power: rx51_battery: Replace hardcoded channels values." Original code use channel as argument which was shifted by one in function. After mentioned commit argument is already shifted so we need to get index back. Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power/rx51_battery.c')
-rw-r--r--drivers/power/rx51_battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c
index 03f57615be56..1bc5857b8bd5 100644
--- a/drivers/power/rx51_battery.c
+++ b/drivers/power/rx51_battery.c
@@ -51,7 +51,7 @@ static int rx51_battery_read_adc(int channel)
if (twl4030_madc_conversion(&req) <= 0)
return -ENODATA;
- return req.rbuf[channel];
+ return req.rbuf[ffs(channel) - 1];
}
/*